Fix: Changed PHP Version and Now Can’t Access WordPress Site

Updating the PHP version on your server can improve your WordPress site’s performance, compatibility, and security. However, if you’ve recently changed your PHP version and are now locked out of your WordPress site, don’t worry—it’s a common issue with some simple solutions. This guide will help you troubleshoot and regain access to your WordPress site after a PHP update.


Why Changing PHP Can Cause Access Issues

Why Changing PHP Can Cause Access Issues

Updating PHP can sometimes create compatibility issues with your WordPress theme, plugins, or the WordPress core. Common issues include:

  • Incompatible Plugins or Themes: Some plugins or themes may not be compatible with newer PHP versions, resulting in errors or white screens.
  • Corrupted Cache: Your website’s cached files may not match the new PHP configuration.
  • Server Memory Limits: Higher PHP versions require more server resources, so a low memory limit could be causing access issues.

If you encounter errors like “500 Internal Server Error” or a blank screen after changing PHP, try the following solutions to restore access.


Solutions to Regain Access to Your WordPress Site

1. Revert to the Previous PHP Version

If the new PHP version isn’t compatible with your site, revert to the previous version as a temporary fix. You can often do this through your web hosting control panel.

  • Using cPanel: Go to Select PHP Version or PHP Config in cPanel. Select the previous PHP version and click Save.
  • Plesk: Go to Websites & Domains, select the domain, and then PHP Settings. Choose the previous PHP version and save the settings.

After reverting, refresh your website to see if it’s accessible again. If so, consider updating plugins and themes to ensure compatibility before trying the PHP upgrade again.


2. Rename the Plugin Folder to Disable Plugins

If the PHP update created a conflict with an active plugin, you can temporarily disable all plugins to see if this resolves the issue.

  • Access Your Site via FTP or File Manager: Connect to your site using FTP or through the File Manager in cPanel.
  • Navigate to the Plugins Folder: Go to wp-content > plugins.
  • Rename the Plugins Folder: Change the folder name from plugins to something like plugins_backup. This will deactivate all plugins without deleting them.

Try accessing your site again. If it loads, a plugin conflict was likely the issue. You can revert the folder name to plugins and activate each plugin one by one in your WordPress dashboard to identify the incompatible plugin.


3. Switch to a Default WordPress Theme

If your theme isn’t compatible with the new PHP version, switching to a default WordPress theme can help regain access.

  • Access FTP or File Manager: Connect to your site using FTP or File Manager.
  • Navigate to the Themes Folder: Go to wp-content > themes.
  • Rename Your Active Theme’s Folder: Rename your theme’s folder (e.g., my-theme to my-theme_backup). WordPress will automatically switch to a default theme like Twenty Twenty-One.

Check if you can access your site. If successful, the issue likely lies with your theme, and you may need to update or replace it with a compatible theme.


4. Increase PHP Memory Limit

Sometimes, updating PHP requires additional memory allocation. Increasing the PHP memory limit can help resolve access issues.

  • Edit wp-config.php: Access your site via FTP, find wp-config.php in the root directory, and open it in a text editor.
  • Add Memory Limit Code: Add the following code above the line that says “That’s all, stop editing!”:
    define( 'WP_MEMORY_LIMIT', '256M' );

Save the file and refresh your website to see if it resolves the issue. If this works, your site required more memory to handle the updated PHP version.


5. Clear Cache and Reset .htaccess

Corrupted cache files or an incompatible .htaccess file can also prevent access after a PHP change. Resetting these can help resolve the problem.

  • Delete Cache Files: If you have a caching plugin (like W3 Total Cache or WP Super Cache), delete the cache files. Alternatively, you can clear the cache via your hosting panel.
  • Reset .htaccess File: Access your site via FTP, locate the .htaccess file in the root directory, and rename it to .htaccess_backup. Then, try to access your site. WordPress will automatically generate a new .htaccess file.

If this resolves the issue, go to Settings > Permalinks in your WordPress dashboard and click Save Changes to refresh your permalinks and generate a fresh .htaccess file.


6. Check PHP Error Logs for Specific Issues

Most web hosts provide access to error logs, which can help identify what’s causing the issue.

  • Access Error Logs: In cPanel, go to Errors or Error Logs under the Metrics section.
  • Identify Errors: Look for PHP-related errors or plugin/theme errors. The logs will indicate which file or line is causing the problem, making it easier to locate the issue.

If you identify a specific plugin or theme causing the problem, disable or update it to resolve the conflict.

Final Thoughts

Changing your PHP version is important for security and performance, but it can occasionally lead to issues with site access. By following these troubleshooting steps—reverting PHP, disabling plugins, increasing memory limits, and checking error logs—you can regain access to your WordPress site and ensure it functions smoothly with the updated PHP version.

Still need help? Drop your questions in the comments, and we’ll help troubleshoot together!