1

I'm trying to get multiple PHP versions working on a cPanel server which was compiled with mod_fcgid and PHP 5.3.

Below is the PHP config generated by cPanel.

AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml

I did compiled PHP 5.2 from source and placed it's files under /usr/local/php52 then created a wrapper as below;

#!/bin/sh

exec /usr/local/php52/bin/php-cgi

Then added the below to Apache's PHP configuration file.

AddHandler fcgid-script-php52 .php52
FCGIWrapper /usr/local/cpanel/cgi-sys/php52 .php52

I am not sure if this is the correct approach for this. Now what I wonder is how I can have a specific account to utilize this wrapper instead of default one?

1

Your wrapper is looking good as you have compiled the php52 at /usr/local/php52/. make sure that its executable.

chmod a+x file

Also its ownership. use the chown command to do that. Its better for you to go through the following link to get the complete steps to use the mod_fcgid

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.