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 inphp.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 did this steps
In the terminal console you need to edit the correct php.ini, in my case was:
vi /etc/php5/apache2/php.ini
post_max_size = 256M
upload_max_filesize = 256M
I restarted the apache server
/etc/init.d/apache2 restart
And work for me.
You must know about how Google products works.
At least, there are two things you can control.
define('WP_MEMORY_LIMIT', '256M');
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.
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.
sudo /bin/bash
nano /etc/php5/fpm/php.ini
upload_max_filesize = 2M
. In nano, you can search by typing Ctrl W.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.
service php5-fpm restart
In your Google development console dashboard, at the left, under Compute you have Instance of MV
It worked fine for me !
gcloud auth login
Get connection string from web console https://console.developers.google.com
GCS: Run it in Google Cloud SDK Shell to open SSH
gcloud compute --project "your_project-id" ssh --zone "us-central1-a" "wordpress-your_id"
gcloud compute --project "your_project-id" copy-files "wordpress-your_id":/etc/php5/apache2/php.ini php.ini --zone "us-central1-a"
Edit line
upload_max_filesize = 2M
in php.ini located in your Cloud SDK folderGCS: Upload back to the host in your home directory:
gcloud compute --project "your_project-id" php.ini copy-files "wordpress-your_id":~/php.ini --zone "us-central1-a"
SSH: Change user to root in PuTTY:
sudo /bin/bash
cp php.ini /etc/php5/apache2/php.ini
service apache2 restart