How to Increase PHP Version & Memory Limit in WordPress

Running an outdated PHP version or low memory limit can slow down your WordPress website and cause compatibility issues. In this guide, you’ll learn how to increase PHP version and memory limit in WordPress safely and easily.


✅ Step 1: Check Your Current PHP Version & Memory Limit

  1. Go to WordPress Dashboard → Tools → Site Health → Info

  2. Check Server section to see current PHP version and memory limit

Tip: WordPress recommends PHP 8.0 or higher and memory limit of 128M or higher for optimal performance.


✅ Step 2: Upgrade PHP Version via Hosting

Most hosting providers allow you to upgrade PHP from cPanel:

  1. Login to your cPanel

  2. Go to Software → MultiPHP Manager

  3. Select your domain and choose the latest PHP version (e.g., 8.1 or 8.2)

  4. Click Apply

  5. Refresh your website and check for errors

Note: Always backup your website before upgrading PHP.


✅ Step 3: Increase WordPress Memory Limit

There are multiple ways to increase memory limit:

Method 1: Edit wp-config.php

  1. Access your WordPress root folder via File Manager or FTP

  2. Open wp-config.php

  3. Add this line above /* That's all, stop editing! */

define('WP_MEMORY_LIMIT', '256M');
  1. Save changes


Method 2: Edit .htaccess (if allowed by hosting)

Add this line at the top of .htaccess file:

php_value memory_limit 256M

Method 3: php.ini File

  1. Go to your server root folder

  2. Open or create php.ini file

  3. Add this line:

memory_limit = 256M
  1. Save and restart server (if needed)


✅ Step 4: Verify Changes

  1. Go back to WordPress Dashboard → Tools → Site Health → Info

  2. Check Server section

  3. PHP Version and Memory Limit should reflect the new values


📌 Conclusion

Updating your PHP version and increasing WordPress memory limit improves website speed, security, and compatibility. Always take backups before making changes, and use the latest PHP version recommended by WordPress.


FAQ Section

Q1: How do I check my current PHP version in WordPress?
👉 Go to Dashboard → Tools → Site Health → Info → Server to see your current PHP version.

Q2: What is the recommended PHP version for WordPress?
👉 WordPress recommends PHP 8.0 or higher for better performance and security.

Q3: How much memory limit is enough for WordPress?
👉 Minimum 128M, but 256M or higher is recommended for large websites or WooCommerce stores.

Q4: Can I increase PHP memory limit myself?
👉 Yes, via wp-config.php, .htaccess, or php.ini, but always backup your site first.

Q5: What happens if I don’t update PHP version?
👉 Older PHP versions may cause slower websites, security risks, or plugin/theme incompatibility.

Share this project

Leave a Reply

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