Unable to upload file even after updating php.ini
I recently added a linode and deployed wordpress using stack script. Am unable to upload a theme and it shows me this error -
> "The uploaded file exceeds the uploadmaxfilesize directive in php.ini."
I updated -
upload_max_filesize = 20M
post_max_size integer = 32M
max_execution_time = 240
memory_limit = 128M
fields in my php.ini file and restarted my server multiple times. But it still doesn't help. Am unable to upload the file and am getting the same error.
My apache/php versions are -
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jan 14 2016 17:45:23
phpinfo()
PHP Version => 5.5.9-1ubuntu4.14
System => Linux localhost 4.5.0-x86_64-linode65 #2 SMP Mon Mar 14 18:01:58 EDT 2016 x86_64
Build Date => Oct 28 2015 01:31:23
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
Please tell me how do I fix this?
Regards,
4 Replies
How big is your file that you're trying to upload? Can you confirm you saved the php.ini file after making that change? Can you try making the file size even larger?
Regards,
Soh
Am trying to upload a theme file(.zip) of size 3.7MB. Yes, I have saved my php.ini file and I have tried using following values -
upload_max_filesize = 40M
post_max_size integer = 64M
max_execution_time = 240
memory_limit = 128M
But, still it doesn't help. Do you need login password and check for yourself?
Regards,
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
In my case (Debian most likely similar on many distributions) for Apache I edit: /etc/php5/apache2/php.ini
If I am using php-fpm: /etc/php5/fpm/php.ini
They both can be configured otherwise or possibly copied over each other or symlinked. I would make backups of the original tho. The files that are outputting in the paste inside your post are the php.ini for the command line PHP.
Of course be sure to reload apache and PHP-FPM (if applicable)
You were correct. I had two php.ini files -
* /etc/php5/apache2/php.ini
/etc/php5/cli/php.ini</list>
phpinfo() from command line showed configuration for cli
But the website was using /apache2/php.ini configuration file.
I updated the changes in /apache2/php.ini and it worked.
Thanks for your help.
Regards,