How to Switch your Dedicated Server from suPHP to FastCGI

suPHP to FastCGI Hero Image

In this tutorial we will briefly go over how to switch your server from using suPHP to something else such as CGI, FastCGI, etc. This article already assumes that you have root access to your system.

Check current available configurations

  1. Log into your servers command line via the root user.
     
  2. Run the following red command to check what options are available on your server.
    /usr/local/cpanel/bin/rebuild_phpconf –current
    Available handlers: suphp fcgi cgi none
    DEFAULT PHP: 5
    PHP4 SAPI: none
    PHP5 SAPI: suphp
    SUEXEC: enabled
    RUID2: not installed
     

Switch your server to FastCGI

  1. Log into your servers command line via the root user.
     
  2. Run the following red command to change the system from suPHP to FastCGI.
    /usr/local/cpanel/bin/rebuild_phpconf 5 none fcgi enabled
    [/usr/local/cpanel/scripts/set_mailman_archive_perms] Setting I/O priority to reduce system load: best-effort: prio 6
    [/usr/local/cpanel/scripts/set_mailman_archive_perms] Setting mailman archive permissions
    [/usr/local/cpanel/scripts/set_mailman_archive_perms] Continuing in the background
    php.conf updated to:

     

    # This file was automatically generated by the Cpanel PHP Configuration system
    # If you wish to change the way PHP is being handled by Apache on your system,
    # use the /usr/local/cpanel/bin/rebuild_phpconf script or the WHM interface.
    #
    # Manual edits of this file will be lost when Apache is updated.

    # Fastcgi configuration for PHP5
    LoadModule fcgid_module modules/mod_fcgid.so
    MaxRequestsPerProcess 500
    AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml
    FcgidWrapper /usr/local/cpanel/cgi-sys/php5 .php5
    FcgidWrapper /usr/local/cpanel/cgi-sys/php5 .php4
    FcgidWrapper /usr/local/cpanel/cgi-sys/php5 .php
    FcgidWrapper /usr/local/cpanel/cgi-sys/php5 .php3
    FcgidWrapper /usr/local/cpanel/cgi-sys/php5 .php2
    FcgidWrapper /usr/local/cpanel/cgi-sys/php5 .phtml

    # End of autogenerated PHP configuration.

    Updating user configurable PHP settings.
    [info] recursion depth is set to: 2
    Restarting Apache

     
  3. Run the following red command to confirm the changes have been made.
    /usr/local/cpanel/bin/rebuild_phpconf –current
    Available handlers: suphp fcgi cgi none
    DEFAULT PHP: 5
    PHP4 SAPI: none
    PHP5 SAPI: fcgi
    SUEXEC: enabled
    RUID2: not installed
     
InMotion Hosting Contributor
InMotion Hosting Contributor Content Writer

InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!

More Articles by InMotion Hosting

0 thoughts on “How to Switch your Dedicated Server from suPHP to FastCGI

  1. Thanks Tim. Always appreciating you folks. VPS2000, with EA4. I’ve since enabled FPM and OPcache is now working. Looks like I’m good to go now – I hope 🙂

    1. It depends on the version of EasyApache you are running. EasyApache 4 does not support FastCGI. I’d suggest reaching out to Support to see if they can determine what you will need to do to run FastCGI.

Was this article helpful? Join the conversation!