I'm looking to get apache/php to identify the road to my git. I've been researching and searching in most corners from the web and can't find how to get this done. Essentially, regardless of what I attempt, after i run
echo phpinfo(); the
Apache Environment path doesn't vary from
/usr/bin:/bin:/usr/sbin:/sbin. So when I run
system('echo $PATH'); in PHP, it reads exactly the same.
- Macosx (Lion)
- Apache 2 (running as _www)
- PHP 5.3.6
Here's what I've attempted editing to date:
Nothing I've attempted to date has transformed the
$PATH variable. Any ideas?
So this is actually the final solution. I edited the
<key>EnvironmentVariables</key> <dict> <key>PATH</key> <string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin</string> </dict>
What about setting the road atmosphere variable in
Have you update the road atmosphere variable of user '_www'? Apache will read atmosphere variables in the user runs itself. Or, it appears as if you did not restart apache after upgrading PATH atmosphere variable.
- Browse the older discussion :
And when you need to modify atmosphere variable in PHP, getenv() and putenv() could be a better option.
for ubuntu server, in /etc/apache2/envvars, for centos server, in /etc/sysconfig/httpd, to include:
export PATH=<your php cli path>
and restart apache