• Uncategorized

About php : Unable-To-Save-Changes-To-PHPini-File-On-Amazon-Linux-2

Question Detail

I have tried everything I can think of to save the changes (upload_max_filesize) to the php.ini file on amazon linux 2.

I’ve tried:

sudo systemctl restart php-fpm
sudo systemctl restart httpd

Also tried the ini_set function

ini_set('upload_max_filesize', '20M');

Also tried using .htaccess file

php_value post_max_size 20M
php_value upload_max_filesize 20M

Nothing seems to save the changes. What I’m I missing?

Question Answer


Check PHP version and open its PHP.ini file. I installed many PHP versions and edited the wrong PHP.ini many times


Create a Page called phpinfo.php with the following inside:


Access it to check the Master Values and Local Values. You’ll also get the php.ini configuration file location and edit it instead of ini_set. When the Master Values are modified, it’s applicable to all apps running the same PHP version.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.