简体   繁体   中英

Setting $PATH in xampp osx

Good morning all, I have a little problem with variable $PATH in my .bash_profile file.

I have an OSX system with XAMPP installed. I have edit my .bash_profile in this way:

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:

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. I have followed this link but I have the same problem:

Mac OSX PHP and XAMPP path issue

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 . 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.

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 . Eg:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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