Alessandro Minoccheri
Alessandro Minoccheri

Reputation: 35973

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

Upvotes: 1

Views: 4073

Answers (1)

deceze
deceze

Reputation: 522081

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. E.g.:

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

Upvotes: 3

Related Questions