Max WP upload limit won't change after editing php.ini

3 min read 06-10-2024
Max WP upload limit won't change after editing php.ini


Frustrated with Your WordPress Upload Limit? Here's How to Fix It (Even After Editing php.ini)

Problem: You've successfully changed the upload_max_filesize and post_max_size values in your php.ini file, but WordPress still insists on a lower upload limit. This can be incredibly frustrating, especially when trying to upload large images, videos, or other files.

Rephrased: Imagine trying to upload a high-quality photo to your WordPress website, only to be met with an error message saying it's too large. Even after you've adjusted the settings in your php.ini file, the problem persists. This guide will help you conquer this common WordPress hurdle and finally upload those large files!

Scenario & Code:

Let's say you have a php.ini file with the following values:

upload_max_filesize = 100M
post_max_size = 100M

However, when you attempt to upload a file exceeding, say, 50MB, WordPress throws an error. This indicates that the changes to your php.ini file haven't been applied correctly.

Insights & Analysis:

There are a few reasons why your php.ini changes might not be taking effect:

  • Incorrect File Path: You might be editing the wrong php.ini file. Different hosting environments may have multiple php.ini files, and you need to target the one that's actually used by WordPress.
  • Server Configuration: Your hosting provider might have stricter upload limits set at a server level, overriding your php.ini modifications.
  • .htaccess File: A .htaccess file in your WordPress root directory can sometimes set custom upload limits that conflict with your php.ini settings.
  • Plugin Interference: Certain WordPress plugins can modify upload settings and potentially interfere with your intended upload limit.

Troubleshooting & Solutions:

  1. Verify php.ini Location:

    • Contact your hosting provider: Ask them for the correct path to your php.ini file.
    • Use the phpinfo() function: Create a simple PHP file with <?php phpinfo(); ?> and upload it to your WordPress root directory. Access this file in your browser, and search for the Loaded Configuration File entry to find the path to your php.ini.
  2. Check Server Limits:

    • Contact your hosting provider: Inquire if there are any server-level upload limits in place and if they can be adjusted.
  3. Inspect .htaccess:

    • Open the .htaccess file: Use an FTP client to access your WordPress root directory and open the .htaccess file.
    • Search for upload limits: Look for any lines related to upload_max_filesize or post_max_size. If you find any, you can either comment them out or adjust them to match your php.ini settings.
  4. Disable Conflicting Plugins:

    • Temporarily deactivate all plugins: To isolate the problem, deactivate all your WordPress plugins one by one while testing the upload limit. If the problem disappears when a specific plugin is disabled, it's likely interfering with your settings.

Important Note: It's crucial to back up your files before making any changes to your php.ini or .htaccess files.

Additional Tips:

  • Consider using a file manager plugin: Plugins like "File Manager" or "WP File Manager" provide a convenient interface to manage your files and set upload limits.
  • Upgrade your hosting plan: If your hosting plan has limitations that can't be easily overcome, consider upgrading to a plan that offers higher upload limits and more resources.

Resources:

Conclusion:

By understanding the potential causes of your upload limit issues and following these troubleshooting steps, you should be able to successfully increase your WordPress file upload limits and upload large files without any errors. Remember to contact your hosting provider if you need assistance or have specific server-level concerns.