mac上的apache2的$ PATH环境变量 [英] $PATH environment variable for apache2 on mac
问题描述
我试图让apache / php识别我的git的路径。我一直在研究和查看网络的所有角落,无法找到如何做到这一点。基本上,无论我尝试什么,当我运行 echo phpinfo();
Apache环境
路径不会从的/ usr / bin中:/ bin中:/ usr / sbin目录:/ sbin目录
。当我在PHP中运行 system('echo $ PATH');
时,它读取相同。
I am trying to get apache/php to recognize the path to my git. I have been researching and looking in all corners of the web and cannot find how to do this. Basically, no matter what I try, when I run echo phpinfo();
the Apache Environment
path does not change from /usr/bin:/bin:/usr/sbin:/sbin
. And when I run system('echo $PATH');
in PHP, it reads the same.
系统信息
- Mac OSX(Lion)
- Apache 2运行为_www)
- PHP 5.3.6
这是我已经尝试编辑很远:
Here is what I have tried editing so far:
- / etc / profile
- 〜/ .bash_profile $ b $
- /etc/path.d/ {NEW_FILE}
- /etc/profile
- ~/.bash_profile
- ~/.profile
- /etc/path
- /etc/path.d/{NEW_FILE}
目前为止,我没有尝试过更改$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $任何想法?
Nothing I have tried so far has changed the $PATH
variable. Any ideas?
解决方案
所以这里是最终的解决方案。我编辑了
So here is the final solution. I edited the
/System/Library/LaunchDaemons/org.apache.httpd.plist
并添加
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin</string>
</dict>
推荐答案
您可以在<$ c中设置PATH环境变量$ c> /System/Library/LaunchDaemons/org.apache.httpd.plist 。
更多的 docs 。
这篇关于mac上的apache2的$ PATH环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!