The uploaded file exceeds the upload_max_filesize directive in php.ini

Ok. You set up Wordpress. You go to upload a theme. Bam! You get this error:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

*Solution tested on Apache (Debian 8) Version 2.4.10

Now what? Don't even bother searching Google like crazy...it's already here! Optionally, you can do this after deploying a template on Google or AWS (Haven't check Azure) and save yourself the headache.

1. Launch a Google Cloud Platform (Wordpress) VM - Use the Google Click-to-Deploy version.
Note: This will also work with anything that you install on CentOS, Ubuntu, SUSE or RHEL for Apache installations Only (NGINX go Here: https://goo.gl/xeGbSE)

2. Post Installation. Change the configuration with the vi editor under the php path under /etc/php5

4. username@servername:/var/www/html/wp-admin$ sudo vi /etc/php5/apache2/php.ini

When you enter vi. You search with / command (key next to shift) "/upload_max_" (don't put the "). Comment out the line above (you never know...) and then write to the file and save it.

;upload_max_filesize = 2M
upload_max_filesize = 50M
post_max_size = 50M
:wq!
5. username@servername:/var/www/html/wp-admin$ sudo /etc/init.d/apache2 restart
6. Dance for freaking joy!! Now Envato Themes are worth it. https://themeforest.net/
7. Setup DNS and then Encrypt with SSL from Let's Encrypt (Digital Ocean/Let's Encrypt): https://goo.gl/XH6Ex5
8. Don't forget to secure your servers with a snapshot (Google Cloud Platform, Azure or AWS) and then scan and secure weaknesses with either a DISA STIGS or a CIS Benchmark. Be careful out there. It's the wild...wild...west for those that take security for a joke.


Popular posts from this blog

How to Configure HP ILO 4 for Active Directory Login

How to Configure BGInfo for Windows Server 2012 R2

How to Fix /storage/core filesystem Out of Disk Space Error on VCSA 6.0U1