Getting upload_max_filesize message during file upload

251 Views Asked by At

I am getting an error "The uploaded file exceeds the upload_max_filesize limit." when trying to upload a file with wordpress. I found multiple eventual solutions but none of then worked with me

I tried to edit the .htaccess file by adding this lines

php_value upload_max_filesize 50M
php_value post_max_size 50M

but after adding the lines, the website I get 500 Internal Server error when I try to access the website.

I tried to edit the php configuration from Cpanel. I augmented the upload_max_filesize 50M but still getting an error when trying to upload a 4M file.

I located and modified the php.ini file, restarted the server and still get the error.

1

There are 1 best solutions below

0
On

Try to set following variables in .htaccess file-

php_value upload_max_filesize <INTEGER_VALUE_HERE> 
php_value post_max_size <INTEGER_VALUE_HERE>
php_value memory_limit <INTEGER_VALUE_HERE>    

If you still gets the Internal server error, means you don't have permission to set/edit .htaccess file.In this case you need to contact your Hosting provider.