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:

  1. 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.
  2. 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, where 7.x is your PHP version. You can use the find command to locate it:arduinoCopy codesudo find / -name php.ini
  3. Edit the php.ini file. Once you’ve found the php.ini file, open it with a text editor. You can use nano for this:
    sudo nano /etc/php/7.x/apache2/php.ini
    Replace /etc/php/7.x/apache2/php.ini with the path to your php.ini file.
  4. 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
  5. Save and close the file. If you’re using nano, you can do this by pressing Ctrl + X, then Y to confirm the save, and finally Enter to confirm the file name.
  6. 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.

Similar Posts