Changed upload_max_filesize in php.ini but phpinfo doesn't show the change

寵の児 提交于 2019-12-04 12:49:21

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

Nick_Cash

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!