I'm having a problem running a command in php using APC in my mac. In the MAMP Pro i have it on but looks like my mac is not using MAMP's php but using osx'.
Any idea about how to tell my mac to use MAMP Pro instead of OSX' php.ini?
If you're using MAMP Pro then, it easier to find the php. ini file. All you need to do is have MAMP Pro open, then click File > Edit Template > PHP and choose the version of PHP you are running (either php 5.2. 17 or php 5.3.
ini. macOS: /Applications/MAMP/bin/php/phpx. x.x/conf/php. ini.
Open MAMP PRO and click on the “PHP” entry in the sidebar in the “Languages” area. Activate the “Activate command line shortcuts for the selected PHP version, pear & pecl” checkbox. Restart your servers.
With MAMP's PHP bin directory first in line, it will find php there. If you're curious, run echo $PATH to see the whole list.
The MAMP Pro PHP executable should be located in /Applications/MAMP/bin/php/php5.x.x/bin/.
The OSX PHP is located in /usr/bin/php and /usr/bin is in PATH variable by default.
One way to make OSX use MAMP PHP is to add /Applications/MAMP/bin/php/php5.x.x/bin/ to your PATH variable (before /usr/bin):
Simply edit ~/.profile (ie. open Terminal.app, type vim ~/.profile) and add the following line to end of the file:
export PATH=/Applications/MAMP/bin/php/php5.x.x/bin/:$PATH
Note that you should replace xs in php5.x.x with the MAMP Pro PHP version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With