I'm a noob and using Wordpress on Google cloud. When attempting to upload a new theme, I get the following error message:
The uploaded file exceeds the upload_max_filesize
directive in php.ini
.
This is a limitation seems to be set by Google Compute Engine. I've found info about the limitation being set in the php.ini
file, but I can't seem to locate that file anywhere.
Can anyone give some idiot proof, step-by-step instructions to increase the upload size beyond 2MB? I've installed the WP plug-ins that should do this, but the problem must be server side.
I'm not sure what operating system you are using or what version of PHP you are using. I run an Ubuntu 12.04 instance from Amazon Web Services using PHP-FPM. But, the instructions should be basically the same for you. The directory where your php.ini file is saved may be slightly different in item 3. Go hunt for it.
- Log in to your server via SSH.
- Change user to root:
sudo /bin/bash
- Edit the php.ini file:
nano /etc/php5/fpm/php.ini
- Find the line that says
upload_max_filesize = 2M
. In nano, you can search by typing Ctrl W.
- Change to whatever file size you want Whatever you type must have an M (megabytes) or G (gigabytes) at the end (e.g.
upload_max_filesize = 200M
or =1G
).
Aim for the lowest number that you NEED, and keep in mind that PHP has another setting elsewhere that sets how long it will wait before a timeout. You can set a 2G upload limit, but if your timeout is 30 seconds you're still going to fail unless you can upload 2G in 30 seconds. As a general rule, aim low.
- Type Ctrl X to exit, save your file changes.
- Restart PHP by typing
service php5-fpm restart
In your Google development console dashboard, at the left, under Compute you have Instance of MV
- click to see all your instance parameters
- click on ssh button to access to your server
- tape find / -name php.ini to find the directory of your php.ini
- tape sudo nano in my case it was sudo nano /etc/php5/apache2/php.ini
- find the line upload_max_filesize = 2M and change it to 20M or more
- restart your server with sudo /etc/init.d/apache2 restart
It worked fine for me !
You must know about how Google products works.
At least, there are two things you can control.
- The memory that WP itself will try to use as max:
define('WP_MEMORY_LIMIT', '256M');
- The value of the "container" you are using (600Mhz/128Mb on the free usage).
Even if it's running PHP, it's using their own infraestructure, based on Python and using it's own config files. So no .htaccess or php.ini will be parsed here. Just the config files that you can read about on the Documentation.
Anyway, im watching people's reports and being know that you can at least run the 128Mb of the minumun instance. Also, i don't recommend you to use AppEngine to host a blog.