themarkappleby
themarkappleby

Reputation: 704

php.ini resetting on MAMP server restart

I am trying to change display_errors = Off to display_errors = On in my php.ini. I ran phpinfo() and verified the Loaded Configuration File (it is located here: /Library/Application Support/appsolute/MAMP PRO/conf/php.ini).

Everytime I edit the display_errors value of this php.ini file and restart my MAMP server, the php.ini file seems to reset. If I open the php.ini file again after restarting MAMP it shows display_errors = Off.

Why might MAMP be resetting the php.ini file?

note - I'm using MAMP Pro if that makes a difference.

Upvotes: 10

Views: 10730

Answers (3)

Peter Drinnan
Peter Drinnan

Reputation: 4532

You can set php.ini values with the template editor in Mamp Pro.

File -> Edit Template -> PHP (php.ini)

Select the same version your instance is running.

When you save the template Mamp will overwrite the php.ini file used for your instance and restart Apache.

Edit PHP INI WITH MAMP TEMPLATE EDITOR

Upvotes: 3

Dan Jackson
Dan Jackson

Reputation: 246

The way I have done it was to change the template that MAMP Pro replaces your php.ini file with. In my case the ini file that PHP was loading was found at

/Library/Application Support/appsolute/MAMP PRO/conf/php.ini

but everytime I changed it, MAMP Pro wrote over it with its own version. To change what I wanted to change in the php.ini file, I simply found the template:

/Applications/MAMP PRO/MAMP PRO.app/Contents/Resources/php5.4.4.ini 

(PHP 5.4.4 is the version i'm using) and then I changed what I needed to change :D Hope this helps

Upvotes: 23

themarkappleby
themarkappleby

Reputation: 704

I finally figured it out. MAMP Pro works differently than regular MAMP. With regular MAMP you would edit the appropriate php.ini file directly. With MAMP Pro however you have to use the MAMP Pro interface to control the php.ini settings. MAMP Pro recreates the php.ini file each time the server starts based on these settings.

In my case, to display server errors I had to open the MAMP Pro interface. Click on the Server tab. Click on the PHP tab. Check the Display startup errors checkbox. Check the All errors and warnings checkbox. Check the Display checkbox. Apply the changes and restart the server.

Upvotes: 1

Related Questions