Basically phpinfo says upload_max_filesize is 2M, but I changed it in the php.ini file to 8M. I am using MAMP, so I restarted MAMP and phpinfo still says 2M. I checked the path to the php.ini file that phpinfo shows and it matched up exactly. See the YouTube video of me documenting all of this.
You should change the file in /Applications/MAMP/bin/php/php5.4.10/conf/php.ini
After you should reset MAMP. I also changed all php.ini before, and phpinfo() doesn't had been change, but I don't sure if it is need to works, so if only changing the file in the path above, try change the others also.
I hope that help you.
To be sure, write a file with this PHP content:
<?php
phpInfo();
?>
and save it in your main MAMP document root (as any other web page) with name info.php
Open that file as a web URL in your browser as any other MAMP web page, as an example: http://127.0.0.1:8888/info.php
Search for the string: php.ini
in that page.
You will find a line like this:
Configuration File (php.ini) Path /Applications/MAMP/bin/php/php7.2.8/conf
That line will show you the correct path for the ini file PHP is using in that moment. It depends on the PHP version you are using.
Delete (or rename with an unguessable name) the info.php file, after (avoid giving all this info to the world).
In httpd.conf file the PhpIniDir had the wrong path. It was off by one directory. That was the fix!
MAMP PRO php config file is loaded from other path.
I found it after replace all php infos from mamp/bin/php/ directory without results.
/Applications/MAMP PRO/MAMP PRO.app/Contents/Resources/php(VERSION).ini
I have the same problem with MAMP (non pro), MAM is stopped the current php version I am using is php7.2.20, I have changed everywhere in /Applications/MAMP/bin/php/php7.2.20 and /Applications/MAMP/conf/php7.2.20
post_max_size = 128M upload_max_filesize = 128M
I restart MAMP and I get php7.2.20 post_max_size = 8M upload_max_filesize = 32M
On MAC os make sure you are at the right path
:
/Applications/MAMP/bin/php/phpx.x.x/conf/php.ini
I see a lot of people had trouble with this since there is also another conf directory
来源:https://stackoverflow.com/questions/13638868/changed-upload-max-filesize-in-php-ini-but-phpinfo-doesnt-show-the-change