简体   繁体   English

在xampp osx中设置$ PATH

[英]Setting $PATH in xampp osx

Good morning all, I have a little problem with variable $PATH in my .bash_profile file. 大家早上好,我的.bash_profile文件中的变量$ PATH有点问题。

I have an OSX system with XAMPP installed. 我有一个安装了XAMPP的OSX系统。 I have edit my .bash_profile in this way: 我用这种方式编辑了我的.bash_profile:

export XAMPP_HOME="/Applications/XAMPP/xamppfiles"
export PATH="${XAMPP_HOME}/bin/php-5.4.22:${PATH}"
export PATH="$PATH:/Users/alessandrominoccheri/Sites/site.com/lib/Cake/Console"
export PATH

After I have restart apache and write into console: 我重新启动apache并写入控制台后:

source ~/.bash_profile

and type: 并输入:

which php

But always return me: 但总是回报我:

/usr/bin/php

How can I change path? 我怎样才能改变路径? I have changed permission on bin folder but same problem. 我已经更改了bin文件夹的权限,但同样的问题。 I have followed this link but I have the same problem: 我已经关注此链接,但我遇到了同样的问题:

Mac OSX PHP and XAMPP path issue Mac OSX PHP和XAMPP路径问题

If ${XAMPP_HOME}/bin/php-5.4.22 is the executable, then adding it to your path doesn't help you in being able to call it using php . 如果${XAMPP_HOME}/bin/php-5.4.22是可执行文件,那么将它添加到您的路径并不能帮助您使用php调用它。 The $PATH needs to contain directories in which executables are, which will be searched in the order they're defined whenever you mention any executable by name. $PATH需要包含可执行文件所在的目录 ,只要您按名称提及任何可执行文件,就会按照它们定义的顺序进行搜索。

You either want to alias your php-5.4.22 to php in your profile, or maybe better, create a symlink for it that overrides your default php . 你想要在你的个人资料php-5.4.22你的php-5.4.22 aliasphp ,或者更好,为它创建一个覆盖默认php的符号链接。 Eg: 例如:

$ ln -s ${XAMPP_HOME}/bin/php-5.4.22 /usr/local/bin/php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM