Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does MAMP keep its php.ini?

Tags:

php

macos

mamp

I have recently got a mac an am not used to developing on a mac at all.

I have MAMP Pro 1.9.6.1. I did a locate on php.ini and got this:

$ locate php.ini /Applications/MAMP/conf/php5.2/php.ini /Applications/MAMP/conf/php5.3/php.ini /Library/Application Support/appsolute/MAMP PRO/conf/php.ini /private/etc/php.ini.default 

I changed the name of all of them. Restarted MAMP. It loaded without a hitch (I know odd right?). I am using PHP version 5.2.

All of these files are now different names (done one by one for process of elimination). So I figure restart the mac. Same, MAMP loaded no problems, even though all of the php.ini files had been move. On Lamp this that wouldn't even load. But either there is another php.ini file I'm missing (quite possible I don't know how to updatedb), MAMP is really intelligent and just pulls in all of them (less likely) or it doesn't use one.

like image 813
James Vince Avatar asked Jul 27 '12 16:07

James Vince


People also ask

Where is PHP ini in MAMP Mac?

ini file for each of the PHP versions present in MAMP. You can find it here (where “x.y.z” stands for the corresponding PHP version): “/Applications/MAMP/bin/php/phpx. y.z/conf/php. ini”.

Does MAMP include PHP?

This tutorial shows you how to set up PHP on the MAMP (Macintosh, Apache, MySQL, PHP) package, which includes the Apache web server, the MySQL database server, and the PHP engine. MAMP is intended as a PHP development environment for the Mac, which can work seamlessly with the NetBeans IDE.


2 Answers

Note: If this doesn't help, check below for Ricardo Martins' answer.


Create a PHP script with <?php phpinfo() ?> in it, run that from your browser, and look for the value Loaded Configuration File. This tells you which php.ini file PHP is using in the context of the web server.

like image 71
drew010 Avatar answered Oct 06 '22 00:10

drew010


I'm not sure if in MAMP (non-PRO) is the same, but MAMP overrides the modified php.ini everytime it starts.

In my case, I needed to use the MAMP menu to change my php.ini file (File -> Edit Template -> PHP -> PHP 5.xx -> php.ini).

like image 34
Ricardo Martins Avatar answered Oct 05 '22 23:10

Ricardo Martins