Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use MAMP Pro php.ini instead of OSX php

Tags:

php

macos

mamp

apc

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?

like image 990
Nathre Avatar asked Jan 20 '13 04:01

Nathre


People also ask

How do I change the PHP INI in MAMP pro?

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.

Where is the PHP INI file in MAMP?

ini. macOS: /Applications/MAMP/bin/php/phpx. x.x/conf/php. ini.

How do I enable PHP extensions in MAMP?

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.

Does MAMP have PHP?

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.


1 Answers

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.

like image 173
fardjad Avatar answered Oct 04 '22 02:10

fardjad