Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have XAMPP installed on my mac, and I want to make command line PHP use the same executable as XAMPP since I've customized that php's php.ini file.

The php binary I want is located at:


A quick check of where my CLI php is coming from says:

Casey-Flynns-MacBook-Air:~ casey$ whereis php

I've tried adding the following line to my ~/.bash_profile:

export PATH=/Applications/XAMPP//xamppfiles/bin/:$PATH

And a quick test of my $PATH global says its:

    Casey-Flynns-MacBook-Air:~ casey$ echo $PATH

But still when I execute 'php' from my command line it uses the binary I don't want. Anyone know what might be going on?

share|improve this question

See man whereis:

The path searched is the string returned by the sysctl(8) utility for the ``user.cs_path'' string.

Which is on my Mac OS X:
$ sysctl user.cs_path
user.cs_path = /usr/bin:/bin:/usr/sbin:/sbin

Rather use which to verify what your shell would use:
$ echo $PATH
$ which php

Still I think it's not nice to have two programs with the same name in your $PATH, but I see no better solution (I don't think you can get rid of the preinstalled php and removing /usr/bin from PATH is also not really good...).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.