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.inifile. 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.xis your PHP version. You can use thefindcommand to locate it:arduinoCopy codesudo find / -name php.ini - Edit the
php.inifile. Once you’ve found thephp.inifile, open it with a text editor. You can usenanofor this:sudo nano /etc/php/7.x/apache2/php.ini
Replace/etc/php/7.x/apache2/php.iniwith the path to yourphp.inifile. - Modify the file upload size limit. In the
php.inifile, look for the following lines:upload_max_filesize = 2Mpost_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 = 64Mpost_max_size = 64M - Save and close the file. If you’re using
nano, you can do this by pressingCtrl + X, thenYto confirm the save, and finallyEnterto 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.
