Getting user environment variables using PHP
问题 On centos and Redhat I created a file /etc/profile.d/marketing_vars.sh and added following lines to it #Vars for PowerMail export CmsRoot="/var/www/html/cms/" export PMRoot_Dev="/var/www/html/powermail/" export PMRoot_QA="/var/www/html/powermail/" export PMRoot_Pro="/var/www/html/powermail/" On command line i hit "source marketing_vars.sh" and "chmod +x /etc/profile.d/marketing_vars.sh" I then created a test.php file and added these lines to it error_reporting(E_ALL ^ E_NOTICE); echo "PMRoot