How to enable or disable Apache suEXEC and suPHP

December 20, 2022 / Servers, Hosting & Email

In this guide, we have explained how to enable or disable Apache suEXEC and suPHP.

This article explains how to enable or disable Apache suEXEC and suPHP in WHM, which control how PHP scripts run on a cPanel server. These settings are commonly used to improve security, fix PHP permission issues, and manage script execution behaviour. This guide is intended for users with WHM access.

Follow the steps:

  1. Log in to WHM.
    Login to WHM
  2. Click on the “Service Configuration” option.
  3. Select the “Configure PHP and suEXEC” sub-option.
    Select the “Configure PHP and suEXEC”
  4. Now, if you wish to enable or disable “suEXEC”, follow the steps:
  5. a) Click on the “Apache suEXEC” drop-down menu and select the right option.
    b) You may choose to “on or off”.
  6. Click on the “Save New Configuration” button.
    Apache suEXEC
  7. The “Do a dryrun checkbox” at the bottom of the screen before clicking Save New Configuration will compile and display the PHP configuration file before you use it on your server.
  8. In this way, errors and security flaws can be detected before Apache uses this PHP configuration.
  9. The updated PHP settings can be applied to your configuration by clicking Apply Settings.

Notes & Best Practices

  • Enabling suEXEC improves security by running scripts under the site owner’s user instead of nobody.
  • Disabling suEXEC may be required for legacy applications or compatibility testing.
  • Always use Dry Run on production servers to avoid configuration errors.

By following the steps above, you can safely enable or disable Apache suEXEC and suPHP in WHM, allowing you to control PHP execution behaviour, enhance security, or troubleshoot website issues effectively.

Spread the love