How to remove 2 mb upload limit on Google cloud?
The 2MB upload limit is likely a restriction set by PHP in your WordPress installation on Google Cloud Hosting. This limit can be increased by modifying the php.ini
file, which is the default configuration file for PHP. Here’s how you can do it:
- Connect to your instance via SSH. You can do this directly from the Google Cloud Console. Navigate to the VM instances page, and click the SSH button next to your instance.
- Locate your
php.ini
file. The location of this file can vary depending on your setup. For a standard installation, it’s usually located in the/etc/php/7.x/apache2/
directory, where7.x
is your PHP version. You can use thefind
command to locate it:arduinoCopy codesudo find / -name php.ini
- Edit the
php.ini
file. Once you’ve found thephp.ini
file, open it with a text editor. You can usenano
for this:sudo nano /etc/php/7.x/apache2/php.ini
Replace/etc/php/7.x/apache2/php.ini
with the path to yourphp.ini
file. - Modify the file upload size limit. In the
php.ini
file, look for the following lines:upload_max_filesize = 2M
post_max_size = 8M
Change the values to the desired file size limit. For example, to increase the limit to 64MB, you would change the lines to:upload_max_filesize = 64M
post_max_size = 64M
- Save and close the file. If you’re using
nano
, you can do this by pressingCtrl + X
, thenY
to confirm the save, and finallyEnter
to confirm the file name. - Restart the Apache server. For the changes to take effect, you need to restart your Apache server. You can do this with the following command:
sudo service apache2 restart
After following these steps, your upload limit should be increased. Please note that these instructions are for a standard Apache and PHP setup. If you’re using a different setup, the steps might be slightly different.