Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

mamp

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.

like image 998
Amir Avatar asked Nov 30 '12 04:11

Amir


5 Answers

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.

like image 177
Lucio Fonseca Avatar answered Nov 20 '22 06:11

Lucio Fonseca


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

like image 6
Nick_Cash Avatar answered Nov 20 '22 06:11

Nick_Cash


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).

like image 4
FrancescoMM Avatar answered Nov 20 '22 07:11

FrancescoMM


In httpd.conf file the PhpIniDir had the wrong path. It was off by one directory. That was the fix!

like image 3
Amir Avatar answered Nov 20 '22 06:11

Amir


You can update PHP configurations using below:

File(menu) -> Open template -> PHP -> {select PHP version that you want update}

Source: http://blog-en.mamp.info/2009/09/increase-php-memory-limit-with-mamp-pro.html

like image 1
Mayur Chauhan Avatar answered Nov 20 '22 06:11

Mayur Chauhan