Where does MAMP keep its php.ini?
To be clearer (as i read this thread but didn't SEE the solution, also if it was here!), I have the same problem and found the cause: I were modifying the wrong php.ini!
Yes, there are 2 php.ini files in MAMP:
- Applications/MAMP/conf/php5.5.10/php.ini
- Applications/MAMP/bin/php/php5.5.10/conf/php.ini
The right php.ini file is the second: Applications/MAMP/bin/php/php5.5.10/conf/php.ini
To prove this, create a .php file (call it as you like, for example "info.php") and put into it a simple phpinfo()
<?php
echo phpinfo();
Open it in your browser and search for "Loaded Configuration File": mine is "/Applications/MAMP/bin/php/php5.5.10/conf/php.ini"
The error was here; i edited Applications/MAMP/conf/php5.5.10/php.ini but this is the wrong file to modify! Infact, the right php.ini file is the one in the bin directory.
Take care of this so small difference that caused me literally 1 and a half hours of headaches!
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.
The file you have to edit is in MAMP Pro and uses the php.ini
file everytime it starts up.
- Start MAMP PRO
- Edit
File > Edit Templates > PHP 5.3.2 php.ini
- Restart MAMP Pro
Your changes should stick.
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
).