Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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;


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?

share|improve this question

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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