upload_max_filesize in php.ini (one more time)

Hello! I’ve created one click instalaltion. So now I have problem with chfnging upload_max_filesize in php.ini. I’ve found 2 files using: find / -name php.ini

/etc/php5/cli/php.ini /etc/php5/apache2/php.ini

Then I’ve changed upload_max_filesize and restarted apache using: sudo service apache2 restart

But problem is still exists. Please help!

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


I have just set up PHP5 on my server and took a look into your issue. I am using Apache2, so the correct configuration file is located under:


I would prefer to use nano for editing text-based files. When you will you open this file, press on keyboard CTRL+W in order to search “upload_max_filesize” (without quotes). Make sure that it is not doubled in any way. Set it for example 1024M.

upload_max_filesize = 10M

Always, when I am editing this value, I do it for another one so I do not get any complications in the future:

post_max_size = 10M

After you will edit these two variables. Push CTRL+X on keyboard and type “y” so it will save. Since you have changed php.ini file, the restart is required, make it using following command:

service apache2 restart

I hope that it will work in your case, same as mine. Also, remove your changed from php.ini under /cli/ folder. I am using ubuntu 14.04. I recommend to do basic .php file check with phpinfo(); inside in order to check if changes applied.

Regards, slajd77


You can create a php info file in order to check the current values and check which is the php.ini file in use. Create the following file in your public_hmtl folder - phpinfo.php and put the following code inside it:


You can also use the following command in order to find the location of the php.ini file:

php -i | grep php.ini

The output will be:

Configuration File (php.ini) Path => /etc/php/7.2/cli
Loaded Configuration File => /etc/php/7.2/cli/php.ini

Then check for the current value of upload_max_filesize you can also check which is the configuration file - php.ini that is currently used and apply the changes there (if the site using the global php.ini file and you change the values for these settings this will make the changes globally for all sites). Ideally you would like to have the following values:

upload_max_filesize = 64M

You also need to restart your web server in order the changes to take effect.

Hope that this helps! Regards, Alex

Thank you!