I solve the problem as follows: go to script environment variables.
In the case of .htaccess / httpd.conf:
SetEnv SITE_NAME x1
In the case of cron (run a script):
#!/bin/bash
export SITE_NAME=x1;
php /path
In both cases, the PHP code to get this environment variable is: getenv('SITE_NAME');
x1 is an example site name.
source
share