Hello! I’ve created one click instalaltion.
So now I have problem with chfnging uploadmaxfilesize 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 uploadmaxfilesize and restarted apache using: sudo service apache2 restart

But problem is still exists. Please help!

1 comment
  • From the command line you can run:

    php -i | grep “Loaded Configuration File”

    This will tell you the location of the php.ini file you will need to edit.

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.

×
4 answers

Hi,

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:

/etc/php5/apache2/php.ini

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 “uploadmaxfilesize” (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

hi i edited both uploadmaxfilesize and postmaxsize = 10M in /etc/php5/apache2/php.ini. However the problem still exits. Please help

Hello,

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:

<?php
phpinfo();
?>

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 uploadmaxfilesize 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

Submit an Answer