Shopping cart

Subtotal  0

View cartCheckout

How to Increase PHP Limits in WordPress: Comprehensive Guide for 2025

If you’ve encountered errors like “Maximum execution time exceeded” or “File size exceeds the upload limit,” you’re not alone. These issues arise due to the PHP limits set by your hosting provider. Thankfully, WordPress offers several ways to increase limits such as upload size, memory limit, and execution time, ensuring your website functions smoothly.

In this article, we’ll walk you through multiple methods to increase PHP limits using wp-config.php, .htaccess, cPanel, and even hosting provider support. Let’s dive in!


What Are PHP Limits?

PHP limits define how much server memory, time, and resources your WordPress site can use to execute tasks. Hosting providers often set these limits to ensure server stability, but they can be increased as needed.

Here are the most common PHP settings that may need adjustment:

  1. max_execution_time: The time (in seconds) a script can run.
  2. max_input_time: The time allowed for scripts to parse input data.
  3. memory_limit: The maximum memory PHP can use.
  4. upload_max_filesize: The largest file size that can be uploaded.
  5. post_max_size: The maximum size of POST data (form submissions, uploads, etc.).

How to Remove Malware from Your WordPress Website: Best Plugins and Tips


How to Check Your PHP Limits

Before increasing PHP limits, it’s important to know your current values. Here’s how to check them:

  1. Using WordPress Site Health Tool:
    • Go to your WordPress dashboard.
    • Navigate to Tools > Site Health > Info.
    • Expand the Server section to see your PHP settings.
  2. Using a PHP Info File:
    • Create a new file named phpinfo.php in your site’s root directory.
    • Add this code to the file:

<?php phpinfo(); ?>

    • Visit the file (e.g., yourdomain.com/phpinfo.php) to view your PHP configuration.

Common Errors Caused by Low PHP Limits

Here are the errors you might face due to inadequate PHP limits:

  • Fatal error: Allowed memory size of XXXX bytes exhausted.
  • Upload_max_filesize exceeds the allowed limit.
  • Maximum execution time of 30 seconds exceeded.
  • PHP Max Input Vars exceeded.

Let’s look at how to fix these issues.

Method 1: Editing wp-config.php

The wp-config.php file is located in the root directory of your WordPress installation. Here’s how to edit it:

  1. Access wp-config.php:
    • Log in to your hosting account via cPanel or FTP.
    • Navigate to the WordPress root directory (usually public_html or www).
    • Locate the wp-config.php file and open it for editing.
  2. Add the Following Lines: Insert these lines before the /* That's all, stop editing! Happy publishing. */ comment:

# Increase PHP limits
php_value max_execution_time 600
php_value max_input_time 600
php_value memory_limit 512M
php_value upload_max_filesize 500M
php_value post_max_size 500M
php_value max_input_vars 1000

  1. Save and Test:
    • Save the file and refresh your WordPress dashboard.
    • Check if the errors are resolved.

Method 2: Modifying .htaccess

The .htaccess file is used to control server configurations. Here’s how to update it:

  1. Access .htaccess:
    • Use an FTP client or File Manager in cPanel.
    • Locate the .htaccess file in the root directory.
  2. Add the Following Code: Append these lines at the end of the file:

# Increase PHP limits
php_value max_execution_time 600
php_value max_input_time 600
php_value memory_limit 512M
php_value upload_max_filesize 500M
php_value post_max_size 500M
php_value max_input_vars 1000

  1. Save and Test:
    • Save the file and reload your website.
    • Test by uploading a large file or running the process that caused the error.

Method 3: Using cPanel

If your hosting provider offers cPanel, you can update PHP limits without editing files.

  1. Log in to cPanel:
    • Access your hosting account and log in to cPanel.
  2. Open MultiPHP INI Editor:
    • Navigate to Software > MultiPHP INI Editor.
    • Select your domain from the dropdown.
  3. Update PHP Limits: Adjust the following values:
    • max_execution_time: Set to 600.
    • max_input_time: Set to 600.
    • memory_limit: Set to 512M.
    • upload_max_filesize: Set to 500M.
    • post_max_size: Set to 500M.
  4. Save Changes: Click Apply or Save to implement the new limits.

Best SEO Plugins for WordPress: Top 7 Tools for Better Rankings in 2025


Method 4: Using Hosting Support

If you’re on shared hosting, some PHP limits may be locked. In this case, contact your hosting provider and request an increase in limits. Provide the desired values, such as:

  • Memory limit: 512M
  • Upload max filesize: 500M
  • Max execution time: 600

Most hosting providers will accommodate your request.


Method 5: Using Plugins

If you’re not comfortable editing files, use a plugin like WP Memory Limit or Increase Maximum Upload File Size. These plugins simplify the process of adjusting PHP limits.


Troubleshooting Tips

If the changes don’t take effect:

  1. Clear Cache: Clear your browser cache and site cache.
  2. Check for Conflicts: Deactivate plugins or themes that might override settings.
  3. Upgrade Hosting: Consider moving to a VPS or dedicated hosting plan for more flexibility.

Best Practices for Managing PHP Limits

  • Regular Updates: Keep WordPress, themes, and plugins updated to avoid compatibility issues.
  • Monitor Resource Usage: Use tools like Query Monitor to identify resource-heavy processes.
  • Backup First: Always back up your site before making changes to configuration files.

Conclusion

Increasing PHP limits in WordPress is a crucial step to fix common errors and optimize website performance. Whether you edit wp-config.php, modify .htaccess, or use cPanel, these solutions are simple to implement.

Need professional help? Fadnix offers expert WordPress maintenance services to handle technical issues and keep your site running smoothly. Contact us today for assistance!

Leave A Comment

Your email address will not be published. Required fields are marked *