When you are deploying changes to a WordPress website, you might encounter an error about PHP’s upload_max_filesize
:
The uploaded file exceeds the upload_max_filesize directive in php.ini.
Just like the error explains, this means that the file you uploaded exceeds the configured limit of PHP for files uploaded to the server.
This can be a problem if you need to upload a large enough file to the WordPress website. This is not just for uploading large files like images and videos to the WordPress website, but you might also occasionally need to install private WordPress plugins that are not available in the public WordPress plugin directory.
If you do not have access to the server configuration (or if it is not available at the moment), you might find the following workaround useful.
File Manager Workaround
You can install a WordPress plugin that provides a file manager to the WordPress website admin section. Then, using the file manager, you can upload the files not as one large file but as multiple files.
For example, instead of uploading a plugin as a single ZIP file through the web interface, you can upload the decompressed files of the plugin to the plugin directory of WordPress. By uploading them as individual files, you might be able to avoid the file size limit.
You don’t even need to worry about retaining file paths if the file manager supports uploading a folder as is.
Here are some specific steps you can do:
- Install and activate a file manager WordPress plugin, such File Manager Advanced by modalweb. There are many options in the WordPress plugin directory.
- Go to the file manager.
- Navigate to
wp-content/plugins/
. - Extract the WordPress plugin ZIP file in your computer.
- Upload the WordPress plugin local folder.
- In the plugin management page of WordPress, activate your newly uploaded plugin.
- And lastly, you might want to uninstall the file manager plugin if you no longer need it.
Important Reminder
Make sure that the plugins you install are safe!