[Help] Unable to upload a wordpress themes to Ubuntu Lamp 14.04

July 7, 2017 91 views
WordPress Ubuntu

I already set upload_max_filesize and post_max_size to 40M,and check in php.ini file to make sure this is 40M for each of them.

I already set wp-content,wp-admin,and wp-upload all to permission 777 by the following command

chmod 777 /var/www/html/wp-admin
chmod 777 /var/www/html/wp-content
chmod 777 /var/www/html/wp-upload

But I still get this error when I upload the theme in zip file from the wordpress dashboard.Then nothing happen.

 "Are you sure you want to do this?".

One more thing,my themes in zip file is only 189mb,but when I upload in dashboard it take me about 2-3 hours to upload it,then show me the above error.This is make me frustrating.

What I still missing out?I have totally no idea.Please somebody give me some guidance about this.

2 Answers
jtittle MOD July 7, 2017
Accepted Answer


If your theme ZIP file is 189 MB, then you need to set both directives as they work hand in hand with one another.

Generally, I recommend that post_max_size is at least 2-3x upload_max_size.

For example, if

upload_max_size = 200M

then we'd set

post_max_size = 400M


post_max_size = 600M

The reason for this is due to multi-file uploads.


For example, let's say I have three files that are 200M each and I'm uploading all three at once using a web form that submits to WordPress so they end up in the uploads directory.

If post_max_size and upload_max_size are both set to 200M, then the above will fail as each file is 200M and I'd be posting 600M (200M x 3 files). To allow all three files to successfully post, I'd need to set post_max_size to 600M.


To get around the limitation if you don't want to mess with PHP's configuration, you can also upload the theme using SFTP to ./wp-includes/themes that way there's no file limitations imposed.

Hi @matchartproduction

If you've set the upload_max_filesize=40M and you're trying to upload 187MB, then something will fail.
That's an extremely large theme - why is it so big?

My guess would be Apache/PHP is running out of RAM while trying to unzip the file.
But let's see if the last 20 lines in the error log shows something:

tail -20 /var/log/apache2/error.log
Have another answer? Share your knowledge.