Hi,
I am new to GCP and I just installed through WordPress deploy a Wordpress installation. Now I have problems with importing the files of my website. It says that I can only upload 2 MB. I have tried everything what I found here but nothing works well. Can someone help me with a not too technical guidance? I really would appreciate to know if I am doing everything.
To increase the file upload limit in WordPress on Google Cloud Platform (GCP), there are several methods you can try. Here are some steps you can follow:
1. **Check `wp-config.php` file**: The memory limits may be defined in your `wp-config.php` file. Open the file and search for lines that define the memory limits. The location of these limits may vary depending on your theme and WordPress configuration
2. **Modify `php.ini` file**: Another approach is to modify the `php.ini` file. This file contains various PHP configuration settings, including the file upload size limit. Here's how you can do it:
- SSH into your GCP instance.
- Open the `php.ini` file for editing. If you're using the Bitnami version of WordPress on GCP, you can access the `php.ini` file by executing the following command: `nano /opt/bitnami/php/etc/php.ini`.
- Search for the `upload_max_filesize` and `post_max_size` directives in the `php.ini` file. Update their values to the desired file upload size limit. For example, you can set them to `512M` for a 512 MB limit.
- Save the changes and exit the editor.
- Restart the Apache server for the changes to take effect. You can do this by executing the following command: `sudo /opt/bitnami/ctlscript.sh restart`
3. **Increase `upload_max_filesize` and `post_max_size` in `php.ini`**: In addition to modifying the `php.ini` file, you may also need to increase the `upload_max_filesize` and `post_max_size` values in the `php.ini` file. These values determine the maximum size of files that can be uploaded and the maximum size of POST data that PHP will accept, respectively. Make sure to update both values to the desired file upload size limit
4. **Use FTP/SFTP**: If you're still unable to increase the file upload limit using the above methods, you can try uploading large files via FTP/SFTP. This method involves manually uploading the files to your WordPress installation using an FTP/SFTP client. Once the files are uploaded, you can use a plugin like "Add From Server" to import them into WordPress
It's important to note that modifying server configuration files like `php.ini` requires administrative access to your GCP instance. If you're using a managed WordPress solution on GCP, such as Bitnami, you may need to consult their documentation or support resources for specific instructions on increasing the file upload limit.
I know the sure shot solution for this. Let me know if you are still looking for the same.
Hey, do you have a solution for this?
Was able to make it work by making changes in the apache configuration file inside the cli folder. Depending on your server configuration, your file may be situated in a separate folder.
Just insert a blank php file inside your root directory, name it user.php and see the file location displayed when you open the file.
Have tried all solutions. Nothing works when once uses Google Click to Deploy. found the location of loaded configuration file for php.ini, modified that and the server level php.ini file, but still no change. wp-config modification also doesn't work.
If any one was able to change it after having tried all I mentioned, please suggest.
try command sudo nano /etc/php/8.1/fpm/php.ini then change limit.
then restart sudo service php8.1-fpm restart after changing upload limits
THANK YOU, that's the only thing that worked for me. I had the exact same problem, NOTHING would work. The only thing that worked was to modify the php.ini from the fpm folder AND restart with sudo service php8.1-fpm restart command. Why do we have to make the changes from that file specifically and why the regular restart command didn't work that I don't know.
Hey!! It really works for me. I have a VM created from a Wordpress template in GCP, for increase the max file size, just modify in /etc/php/8.1/fpm/php.ini file next parameters:
upload_max_filesize = xxxxM
post_max_size = xxxxM
Thanks for all your recomendations, and hope it works for everyone with the same issue.
To overcome the 2 MB upload limit on GCP WordPress, try these steps:
1. Use Cloud Storage: Upload your files to Google Cloud Storage and link them in your WordPress posts/pages.
2. Modify PHP Settings: Adjust your PHP settings in the `php.ini` file to increase the upload limit. Look for `upload_max_filesize` and `post_max_size`.
3. WordPress Plugins: Install a WordPress plugin like "Increase Maximum Upload File Size" to easily adjust upload limits within the WordPress dashboard.
4. Manual Uploads: If the above steps don't work, manually upload large files using an FTP client to the appropriate directory on your server.
5. Consult Documentation: Refer to Google Cloud Platform and WordPress documentation for specific details and troubleshooting related to file uploads on GCP.
Remember to backup your site before making significant changes.
If you don’t want coding, directly increase max upload size through this free plugin: https://ziscom.in/how-to-increase-max-upload-size/
After installation go to WordPress menu ‘Max Upload Size’ * Only enter the numeric value in bytes * 1024 bytes = 1KB * 1048576 bytes = 1MB
It worked for me. Hope it help for you.
https://github.com/GA0LU/WPUpload-Unlocked-GCP.git try this one