Where is the PHP.INI file used by MAMP?

All MAMP discussions around troubleshooting and anything related to MAMP. Be as detailed as possible here when posting an issue.
Post Reply
jlanpheer
Posts: 9
Joined: Tue May 25, 2021 2:32 am

Where is the PHP.INI file used by MAMP?

Post by jlanpheer »

Hi-
I'm a newb to MAMP and i have installed it successfully on a Mac M1 running Big Sur.

I am attempting to load table data exported from a client site into MySQL installed on my local machine. The problem is that the import into my local database fails with the following error:
>>
"No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16."
<<
Of course, i followed the FAQ and discovered that there's at least 3 parameters to tweak here, the ones that i have tweaked in my php.ini file are as follows:
post_max_size = 256M
memory_limit = 512M
upload_max_filesize = 128M
(as i understand it, these have to have different sizes, with memory_limit being the largest)

The php.ini file that i have modified is in my /Applications/MAMP/bin/php/php7.4.12/conf directory.
I have then used the MAMP console to stop and restart the servers.

I then go to http://localhost:8888/MAMP/?language=English in my browser and go to the phpinfo section. I find the following info there:

PHP version: 7.4.12
post_max_size = 256M
memory_limit = 512M
***upload_max_filesize = 2M ***

The part immediately above is what i don't understand. I've only changed one php.ini file using the above values. I don't see how TWO out of the THREE values that i changed are reflected in the environment. True to form, when i go back into phpAdmin and into MySQL as above and try the import again, the max file size is listed on the import screen as "(Max: 2,048KiB)".

I have NO idea why 2 of the three values that i've changed have their changes reflected in the environment, but the third is unchanged. I'm wondering if the source of it might be somewhere else that the upload_max_filesize variable? Can anybody help me thru the conundrum?

thanks so much!
jim.
mampsupportmod
Site Admin
Posts: 156
Joined: Wed Jan 20, 2021 3:06 am

Re: Where is the PHP.INI file used by MAMP?

Post by mampsupportmod »

MAMP or MAMP Pro?

You need to edit the PHP.INI master template file

Php Ini Template Edit Mamp Forums
Php Ini Template Edit Mamp Forums (114.57 KiB) Viewed 7244 times
MAMP Support Forums is an unofficial support forum covering MAMP & MAMP Pro solution stacks.
jlanpheer
Posts: 9
Joined: Tue May 25, 2021 2:32 am

Re: Where is the PHP.INI file used by MAMP?

Post by jlanpheer »

mampsupportmod wrote: Tue May 25, 2021 11:04 am MAMP or MAMP Pro?

You need to edit the PHP.INI master template file


php-ini-template-edit-mamp-forums.jpg
MAMP, so far. Thanks for the reply, the screenshot you gave me was from MAMP Pro, i don't see that menu option in straight MAMP, i'll see if i can find it in the MAMP installation itself. If i'm looking for something that's not there, please let me know.
thanks,
jim.
jlanpheer
Posts: 9
Joined: Tue May 25, 2021 2:32 am

Re: Where is the PHP.INI file used by MAMP?

Post by jlanpheer »

mampsupportmod wrote: Tue May 25, 2021 11:04 am MAMP or MAMP Pro?

You need to edit the PHP.INI master template file


php-ini-template-edit-mamp-forums.jpg
Based on the information that you gave me, i started looking around the MAMP installation looking for a "template" file. I "think" i found an applicable one at /Applications/MAMP/bin/php/php7.4.12/conf/php.ini.temp (theorizing that the "temp" might be short for "template").

That didn't do it for me either, changing the values as i did above in this file had no effect. If someone can point me to this file, i would appreciate the reply. It seems "odd" to me that changing the values in the actual php.ini file DO reflect in the PHP environment for TWO of the three values in question, doesn't make sense to me, but hey - i'm learning.
thanks,
jim.
Post Reply