A best way to waste 2 hours

 It all began with a simple attempt to have a bit larger WORDPRESS UPLOAD_FILE_SIZE from current 8M to around 20M. I had problem with publishing (uploading) a small book format page which is definitely larger than 8M. Up until then, I didn’t even realize about this upload file size limit set by hosting server (shared linux server at godaddy).

Googling revealed there are many ways to overcome this limit, with varying rate of success depending on various hosting vendors. In case of godaddy, it looks fairly straightforward to tweak php.ini file. It suggests adding two entries on it. In my case, the file name is php5.ini because it was php version 5.x based.


; Maximum size of POST data that PHP will accept.
post_max_size = 20M
 ; Maximum allowed size for uploaded files.
upload_max_filesize = 20M


In my web host setup, there was no php5.ini on my root folder (a virtual folder, not true one), so I had to add it manually after adding the two entries on the file. Now, what’s happened? Uploading a sample file (a picture file), I pleasantly noticed now file size set to 20M! Yeah, it worked! Not so fast! Uploading failed complaining it could not find temporary file directory! What the heck was that? From now on, I knew it began wasting my time. Another googling somehow made me realize WORDPRESS couldn’t not find ‘temporary’ directory information due to my adding php5.ini. Of course, the added php5.ini didn’t ‘override’ temporary directory information, then why, how? In conclusion: I had to delete php5.ini, WORDPRESS now throws no complain, my upload file size reverted back to 8M. What a waste of time!


p.s., Some have suggested using and tweaking .htaccess file for various purpose including file size. I have tried this but it turns out worse than php.ini method, my whole website became inaccessible!


Leave a Reply

September 2017
« Aug