
Increasing WordPress File Upload Size by Updating php.ini File for PHP-FPM on Nginx Server
Many WordPress users encounter frustration when trying to upload large files to their websites, only to find that they exceed the default file upload size limit. However, fear not! There’s a straightforward solution to this problem: updating the php.ini file for PHP-FPM on an Nginx server.
In this guide, we’ll walk you through the process of increasing the WordPress file upload size step by step. By following these instructions, you’ll be able to adjust the upload limit to accommodate larger files, allowing you to upload media files, themes, and plugins with ease.
Firstly, you’ll need to locate the php.ini file on your server. This file contains various PHP settings, including the upload file size limit. The location of the php.ini file may vary depending on your server configuration. Common locations include:
/etc/php/8.x/fpm/php.ini
/etc/php/8.x/cli/php.ini
Note: Replace “8.x” with the version of PHP installed on your server.
Once you’ve located the php.ini file, you’ll need to edit it using a text editor of your choice. You can use nano, vi, or any other text editor installed on your server. For example, to edit the php.ini file using nano, you can use the following command:
sudo nano /etc/php/8.x/fpm/php.ini
Note: Replace “8.x” with the version of PHP installed on your server.
In the php.ini file, search for the following directives:
upload_max_filesize
post_max_size
These directives control the maximum size of files that can be uploaded via PHP. By default, they are typically set to 2MB or 8MB, which may not be sufficient for your needs.
To increase the upload file size limit, you can modify these directives to your desired value. For example, to set the maximum upload file size to 100MB, you would update the directives as follows:
upload_max_filesize = 100M
post_max_size = 100M
Once you’ve made the necessary changes, save the php.ini file and exit the text editor. If you’re using nano, you can save the changes by pressing Ctrl + X
, Followed by ‘Y’, then press Enter
to confirm,
To apply the changes, you’ll need to restart PHP-FPM and Nginx. You can do this using the following commands:
sudo service php8.x-fpm restart
sudo service nginx restart
Note: Replace “8.x” with the version of PHP installed on your server.
By following these steps, you can increase the WordPress file upload size by updating the php.ini file for PHP-FPM on an Nginx server. With a larger upload file size limit, you’ll have more flexibility when uploading media files, themes, and plugins to your WordPress website. This simple adjustment can significantly enhance your WordPress experience and streamline your workflow.
0 Comments
Be the first to comment