serdg

Member
Aug 8, 2016
11
0
1
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello @serdg,

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.
Can you share the specific change you made in EasyApache 3 along with the method you used to make the change?

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.
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.
 

serdg

Member
Aug 8, 2016
11
0
1
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
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.
 

serdg

Member
Aug 8, 2016
11
0
1
Russian Federation
cPanel Access Level
Root Administrator
This should negate the need for you to use a custom wrapper script.
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
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.