SiteSkyline

Fixing the “The uploaded file exceeds the upload_max_filesize directive in php.ini” Error

When managing your WordPress website on a cPanel-based hosting platform, you may encounter the frustrating error message: “The uploaded file exceeds the upload_max_filesize directive in php.ini.” This issue occurs when you try to upload a file that exceeds the maximum file size limit set in the PHP configuration (php.ini) file. However, there’s no need to worry; you can easily resolve this problem through cPanel without having to modify the PHP configuration directly. This knowledge base article will guide you through the steps to fix this error and get your WordPress website running smoothly again.

Step 1: Accessing cPanel

  1. Log in to your cPanel account using the provided credentials (usually in the welcome email from your hosting provider).
  2. Once logged in, you’ll find various sections and icons representing different cPanel functions.

Step 2: Locating the “Select PHP Version” Option

  1. In the cPanel dashboard, look for the “Software” or “Software and Services” section. The exact location may vary depending on the cPanel theme your hosting provider uses.
  2. Within this section, click on the “Select PHP Version” or “MultiPHP Manager” icon. This option allows you to manage PHP settings for your website.
  3. Fixing the "The uploaded file exceeds the upload_max_filesize directive in php.ini" Error

Step 3: Adjusting PHP Settings

  1. After clicking on the “Select PHP Version” or “MultiPHP Manager” option, you will see a list of PHP versions available for your website.
  2. Locate the current PHP version associated with your WordPress installation. You can find this information at the top of the page next to “Current PHP Version.”
  3. Click on the “Options” link next to the current PHP version to modify its settings.
  4. Fixing the "The uploaded file exceeds the upload_max_filesize directive in php.ini" Error

Step 4: Changing the “upload_max_filesize” Value

  1. In the PHP Options section, you will find a list of configurable settings. Look for the setting named “upload_max_filesize.”
  2. Click on the value next to “upload_max_filesize” to reveal a drop-down menu with different size options (e.g., 2M, 8M, 32M, etc.). Select the appropriate size depending on your file upload requirements. If you are unsure, you can set a higher value like 32M to accommodate larger files.
  3. Save the changes by clicking on the “Apply” or “Save” button at the bottom of the page.
  4. Fixing the "The uploaded file exceeds the upload_max_filesize directive in php.ini" Error

Step 5: Verifying the Changes

  1. Once you have adjusted the “upload_max_filesize” value, go back to your WordPress website.
  2. Attempt to upload the file that previously triggered the error. The file should now upload without any issues.

Conclusion:

By following these steps in cPanel, you can easily resolve the “The uploaded file exceeds the upload_max_filesize directive in php.ini” error in your WordPress hosting. Remember to set a reasonable file size limit to ensure your server resources are used efficiently while still accommodating your website’s upload needs. With this knowledge, you can keep your WordPress website running smoothly and efficiently, without any file upload restrictions.