Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Custom FCGI handler

Discussion in 'EasyApache' started by serdg, Apr 5, 2019.

Tags:
  1. serdg

    serdg Member

    Joined:
    Aug 8, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Russian Federation
    cPanel Access Level:
    Root Administrator
    Hi all,

    Is it it possible customize FCGI wrapper in EA4 like EA3?
    I mean in EA3 it was simple bash script, but in EA4 it is some binary program as I can see.

    Is it possible to tune handler extension list? By default (in /etc/httpd/conf/php.conf) PHP process only ".php .php5 .phtml" but some our users need process .html files with php.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,555
    Likes Received:
    2,182
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @serdg,

    Can you share the specific change you made in EasyApache 3 along with the method you used to make the change?

    You can browse to cPanel >> Mime Types to add a new MIME type to an individual account. Documentation on this feature is available at:

    MIME Types - Version 78 Documentation - cPanel Documentation

    Thank you.
     
  3. serdg

    serdg Member

    Joined:
    Aug 8, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Russian Federation
    cPanel Access Level:
    Root Administrator
    Hello,

    sorry for the long time response.
    We use wrapper like this:
    Code:
    #!/bin/bash
    if [ -e ~/php-fcgi ];
    then
            if [ -e ~/php-fcgi/php.ini ];
            then
                    if [ -e ~/php-fcgi/php4 ];
                    then
                            exec /usr/local/cpanel/cgi-sys/php4b -c ~/php-fcgi/php.ini [email protected]
                    elif [ -e ~/php-fcgi/php5 ];
                    then
                            exec ~/php-fcgi/php5 -c ~/php-fcgi/php.ini [email protected]
                    else
                            exec /usr/local/cpanel/cgi-sys/php5b -c ~/php-fcgi/php.ini [email protected]
                    fi
            else
                    if [ -e ~/php-fcgi/php4 ];
                    then
                            exec /usr/local/cpanel/cgi-sys/php4b [email protected]
                    elif [ -e ~/php-fcgi/php5 ];
                    then
                            exec ~/php-fcgi/php5 [email protected]
                    else
                            exec /usr/local/cpanel/cgi-sys/php5b [email protected]
                    fi
            fi
    else
            exec /usr/local/cpanel/cgi-sys/php5b [email protected]
    fi
    
    /usr/local/cpanel/cgi-sys/php5b - default php-cgi file. If customer need some specific configuration we can create ~/php-fcgi/php.ini in his docroot or place custom binary ~/php-fcgi/php5.

    Now - when cPanel in EA4 use binary instead bash script we can't use our wrapper instead.
    I think it will be cool if you allow to use own wrappers for FCGI handlers.
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,555
    Likes Received:
    2,182
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @serdg,

    The built-in MultiPHP functionality in EasyApache 4 includes support for the mod_fcgid Apache module as of cPanel & WHM version 78. This allows you to use cPanel >> MultiPHP INI Editor and cPanel >> MultiPHP Manager to enable custom PHP configuration settings:

    MultiPHP INI Editor for cPanel - Version 78 Documentation - cPanel Documentation
    MultiPHP Manager for cPanel - Version 78 Documentation - cPanel Documentation

    This should negate the need for you to use a custom wrapper script.

    Thank you.
     
  5. serdg

    serdg Member

    Joined:
    Aug 8, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Russian Federation
    cPanel Access Level:
    Root Administrator
    Unfortunately it doesn't.
    We have some customers with unsupported source code for the sites and them very sensitive with PHP version (some of them still should use PHP 5.2).
    New wrapper doesn't allow to build and use custom PHP FCGI handlers and I doesn't understand why.
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,555
    Likes Received:
    2,182
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @serdg,

    If you want to use a custom wrapper for one of the default /usr/local/cpanel/cgi-sys/ea-php## files, the wrapper file should use the same naming convention (ea-php##) and exist in the following location:

    /var/cpanel/conf/apache/wrappers/ea-php##

    The user-submitted steps on the following post may help:

    Individual php.ini files for PHP FCGI and PHP CGI

    Thank you.
     
  7. serdg

    serdg Member

    Joined:
    Aug 8, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Russian Federation
    cPanel Access Level:
    Root Administrator
    Thanks. It's help.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice