mod_fcgi, PHP5, suexec

2 posts / 0 new
Last post
#1 Wed, 02/07/2007 - 23:11

mod_fcgi, PHP5, suexec

Hi all- I'm running Ubuntu 6.06-1, i686, w/ Virtual Pro 3.33. PHP 5.2. I'm having trouble getting FastCGI w/ mod_fcgi to work. I get Internal Server Errors when trying to use it. Here is my basic setup, actions and results:

I setup a Virtual Server and tell it to use FCGId (run as virtual server owner). Virtualmin creates the server and creates a fcgi-bin directory under my /home/mydomain/ and puts two files (php4.fcgi php5.fcgi) in there. The contents are as such (for php5.fcgi):



Perms are 755, owned by my correct user and group.

Virtualmin creates my apache include file and puts this in for the FastCGI stuff (gt / lt removed in order to post):

-Directory /home/mydomain/public_html- Options Indexes IncludesNOEXEC FollowSymLinks ExecCGI allow from all AllowOverride All AddHandler fcgid-script .php AddHandler fcgid-script .php4 AddHandler fcgid-script .php5 FCGIWrapper /home/mydomain/fcgi-bin/php5.fcgi .php FCGIWrapper /home/mydomain/fcgi-bin/php4.fcgi .php4 FCGIWrapper /home/mydomain/fcgi-bin/php5.fcgi .php5 -/Directory-

If I now hit the domain using the FQDN, the virtual host triggers, tries to run my PHP file through FCGI and I get Internal Server error. My apache2/error.log shows: [[Wed Feb 07 22:33:58 2007]] [[notice]] mod_fcgid: process /home/mydomain/public_html/index.php(29510) exit(communication error), terminated by calling exit(), return code: 117

My suexec.log shows: [[2007-02-07 22:33:52]]: uid: (1006/mydomain) gid: (1003/1003) cmd: php5.fcgi [[2007-02-07 22:33:52]]: cannot stat program: (php5.fcgi)

However, if I execute my index.php file via command line using any of the available php commands (php, php5, php5-cgi, php-cgi), it executes fine. Also, if I hit my domain using my main server FQDN/~mydomain (which does not trigger the virtual host directive and just serves the pages as if it were a directory under the main server which uses mod_php), it works just does PhpMyAdmin, which runs similar.

Suexec's error "cannot stat program" is about useless, and I've searched for return code 117 from mod_fcgid and couldn't find anything either (greped the source code for 117 even...). Not sure what I'm doing wrong.

Any advice is appreciated. Thanks!


Thu, 11/22/2007 - 18:08

I'd also like to hear some comments about this. I have a very similar setup and see a very similar error (the only difference being that it shows a return code of 114 instead of 117...

Topic locked