PHP Fatal Errors in cPanel

Estimated reading: 4 minutes

A PHP fatal error occurs when PHP encounters a critical problem that prevents a script from executing. Unlike warnings or notices, fatal errors immediately stop the application, which can result in a blank page, a critical error message, or an HTTP 500 response.

This guide explains the most common causes of PHP fatal errors and provides step-by-step troubleshooting procedures using cPanel.

Overview

PHP fatal errors are typically caused by:

  • Plugin or extension conflicts
  • Theme compatibility issues
  • Unsupported PHP versions
  • Insufficient PHP memory
  • Corrupted application files
  • Missing PHP extensions
  • Incorrect file permissions
  • Programming errors
  • Failed software updates

Resolving the issue usually requires identifying the specific error and correcting the underlying configuration or application problem.

Common Error Messages

You may encounter one or more of the following errors:

Fatal error: Allowed memory size exhausted
Fatal error: Uncaught Error
Call to undefined function
Maximum execution time exceeded
Cannot redeclare function
Class not found
Parse error

Viewing PHP Error Logs

The PHP error log is the best place to begin troubleshooting.

To view recent errors:

  1. Log in to cPanel.
  2. Open Errors or Metrics → Errors.
  3. Review the latest entries.
  4. Identify the affected file, plugin, theme, or script.

Most fatal errors include the filename and line number where the issue occurred.

Enabling PHP Error Reporting

If the logs do not provide enough information, temporary error reporting can help identify the problem.

Add the following code to your PHP application during troubleshooting:

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

After the issue has been identified, disable error reporting to prevent sensitive information from being displayed publicly.

Increasing the PHP Memory Limit

Insufficient PHP memory is one of the most common causes of fatal errors.

You can increase the memory limit using the MultiPHP INI Editor in cPanel.

Recommended values include:

256M

or

512M

If you’re running WordPress, the memory limit can also be increased through the wp-config.php file.

Verifying the PHP Version

Applications may fail if they are running on an incompatible PHP version.

To verify your current version:

  1. Open MultiPHP Manager or Select PHP Version.
  2. Locate the affected domain.
  3. Confirm that the selected PHP version is supported by your application.
  4. Change the version if required.

Using a supported PHP version improves both stability and security.

Checking Required PHP Extensions

Many PHP applications require specific extensions to function correctly.

Common extensions include:

  • mysqli
  • mbstring
  • curl
  • gd
  • intl
  • zip
  • xml
  • openssl

If a required extension is missing, the application may generate fatal errors during execution.

Disabling Recently Installed Plugins

If the error appeared after installing or updating a plugin, temporarily disable it.

For WordPress:

  1. Open File Manager.
  2. Navigate to:
public_html/wp-content/plugins/
  1. Rename the plugin folder.

Example:

example-plugin

to

example-plugin-disabled

Reload the website to determine whether the plugin is causing the issue.

Switching to a Default Theme

Theme conflicts can also generate PHP fatal errors.

Navigate to:

public_html/wp-content/themes/

Rename the active theme folder.

If a default WordPress theme is available, WordPress will activate it automatically.

Replacing Corrupted Application Files

Interrupted updates or incomplete uploads can damage application files.

For WordPress installations:

  • Download a fresh copy of WordPress.
  • Replace the wp-admin and wp-includes directories.
  • Do not overwrite the wp-content directory or the wp-config.php file.

This restores the application’s core files without affecting website content.

Restoring a Backup

If the issue began after recent changes, restoring a backup may resolve the problem.

Depending on your backup system, you may restore:

  • Website files
  • Database
  • Complete cPanel account

Always verify that the backup is current before restoring.

Repairing the .htaccess File

A corrupted .htaccess file can interfere with PHP execution.

To test this:

  1. Open File Manager.
  2. Navigate to your website’s root directory.
  3. Rename:
.htaccess

to

.htaccess_old

Reload the website.

If the issue is resolved, generate a new .htaccess file.

For WordPress:

  • Open Settings → Permalinks
  • Click Save Changes

Reviewing File Permissions

Incorrect permissions can prevent PHP from accessing required files.

Recommended permission values:

ItemPermission
Files644
Directories755

Avoid assigning 777 permissions, as they introduce security risks and may be blocked by the server.

Contacting Your Hosting Provider

If the problem persists after completing the above steps, contact your hosting provider.

Provide the following information if available:

  • Error message
  • Website URL
  • Timestamp of the error
  • PHP version
  • Recent changes made to the website

Your hosting provider can review:

  • PHP error logs
  • Apache or LiteSpeed logs
  • Server resource usage
  • Missing PHP extensions
  • Account permissions
  • Server configuration

These logs often identify the root cause of the fatal error.

Launchpad