Installing suPHP with mod_suphp using EasyApache 4

suPHP is one of a few PHP Handlers availble to choose from. suPHP runs as a CGI module and its major benefits are stronger security and easy permissions management. In this guide, you will learn how to install suPHP with mod_suphp using EasyApache 4.

Installing suPHP

  1. WHM login screen, Username root, Password field filled, and Log in button highlighted

    Log into WHM as root.

  2. easy entered into WHM search field

    Type ‘easy‘ into the search field in the top left of WHM.

  3. WHM Software EasyApache 4 menu option highlighted

    Under the Software category, click on EasyApache 4.

  4. EA4 Currently Installed Packages Customize button highlighted

    In the Currently Installed Packages section, click on the Customize button.

  5. Apache MPM mod_mpm_prefork selected and toggle highlighted

    Click on the toggle button next to mod_mpm_prefork.

    Apache MPM package selection conflict warning message

    If prompted with a warning message, review the conflicts and click the Yes button to proceed.

    Apache MPM mod_mpm_prefork green Installed icon highlighted

  6. Apache MPM section Next button highlighted

    Click the Next button to proceed.

  7. Apache Modules Search field contains mod_suphp and is highlighted

    Under the Apache Modules section, in the Search field, type mod_suphp.

  8. Apache Modules mod_suphp toggle button highlighted

    Click on the toggle button next to mod_suphp to select it to be installed.

  9. Apache Modules section Next button highlighted

    Click the Next button to proceed.

  10. PHP Versions toggle buttons highlighted

    Select the version(s) of PHP you want to install by clicking on the toggle button next to it.

  11. PHP Versions section Next button highlighted

    Click the Next button to proceed.

  12. PHP Extensions section Next button highlighted

    OPTIONAL: Select the PHP Extensions you would like installed. Note that you will need to select the extension for each PHP version you would like it installed for. Once you have completed your selection, click the Next button to proceed.

  13. Ruby via Passenger section Next button highlighted

    OPTIONAL: Select the Ruby via Passenger modules you would like installed. Once you have completed your selection, click the Next button to proceed.

  14. Review section Provision button highlighted

    Your selected packages will be reviewed to ensure conflicts do not exist. After the results display, review them yourself and then click on the Provision button at the bottom of the page to save your selections and provision the package as configured.

  15. Once provisioning completes, you will see a green status message. Click on the Done button to close your EasyApache 4 session.

Change PHP Handler

If you provisioned multiple versions of PHP, additional configuration may be necessary to run suPHP for those PHP versions. Follow the steps below to ensure that all your PHP versions are configured to suPHP handlers.

  1. WHM login screen, Username root, Password field filled, and Log in button highlighted

    Log into WHM as root.

  2. WHM Search field contains multiphp and highlighted

    Type ‘multiphp‘ into the search field in the top left of WHM.

  3. WHM MultiPHP Manager menu option highlighted

    Under the Software category, click on MultiPHP Manager.

  4. MultiPHP Manager PHP Handlers tab highlighted

    Click on the PHP Handlers tab.

  5. PHP Handler Edit link highlighted

    Next to the PHP version, select Edit under the Actions column.

  6. PHP Handler drop-down menu suphp selection highlighted

    Select suphp from the drop-down menu under the PHP Handler column.

  7. PHP Handler Apply button highlighted

    Finally, click the Apply button.

  8. PHP Handler successful status message displayed

    A green status message should appear to confirm the changes were saved.

Confirm PHP Handler

Once you have finished provisioning and setting the PHP handlers for each PHP version, you can confirm the handler(s) set. The instructions below will guide you through the process of confirming the current PHP versions/handlers.

  1. Connect to your server as root via an SSH connection.
  2. Run the following command:

    /usr/local/cpanel/bin/rebuild_phpconf –current

You should see the following output after running that command:

root@localhost ~ $ /usr/local/cpanel/bin/rebuild_phpconf --current 
DEFAULT PHP: ea-php70
ea-php70 SAPI:suphp
ea-php71 SAPI:suphp

Congratulations! You have completed setting your PHP Handlers to suPHP.

JB
John-Paul Briones Content Writer II

John-Paul is an Electronics Engineer that spent most of his career in IT. He has been a Technical Writer for InMotion since 2013.

More Articles by John-Paul

Was this article helpful? Join the conversation!