#1  
Old 22nd February 2010, 09:34
ethanlifka ethanlifka is offline
Junior Member
 
Join Date: Aug 2008
Posts: 29
Thanks: 0
Thanked 6 Times in 4 Posts
Default FastCGI and SuExec Error

I was just about done configuring my new ISPC3 Server.
Then PHP stops working.

My Server: CentOS 5.4 32bit Perfect Setup.
I am using FastCGI with SuExec.
I configured FastCGI to use custom php.ini files.
Installed Mod_Security

Everything Working Great!
Then I noticed that php move_uploaded_files() was setting files to 600 instead of 644. I then added umask 133 to .php-fcgi-starter and it worked. Then I made changes to php-fcgi-starter.master.

No More PHP

Instead I get a 500 Internal Server Error

I reverted php-fcgi-starter.master back to its original, but it didn't do anything.

html still works fine, but its just php.
a simple php file:
Code:
<?php
echo "Hello";
?>
Here are some errors
error_log:
"suexec failure: could not open log file"
"fopen: Permission denied"
"exit communication error terminated by calling exit() return code 1"

I am not sure what file it is refering to.

/var/www/site.com/log/error.log:
file does not exist: /var/www/error/500.html
[error] Premature end of script headers:

I spent about 5 hours with NO success.

I removed mod_security from my httpd.conf, but still nothing.
restarted httpd
rebooted server

Still nothing.

I found a few suggestions and one was to add:
AddType application/x-httpd-phpcgi .php
Action application/x-httpd-phpcgi /cgi-bin/php.cgi
to my .htaccess file, but when I do that I get a 403 Forbidden Error even if I set my .php file to 777.

Then I completely removed my site from ISPC server and re-installed it and still get a 500 Internal Server Error.

Any help would be great.

Thanks
Reply With Quote
Sponsored Links
  #2  
Old 22nd February 2010, 10:13
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

Please post the exact error message from the error log of the website.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 24th February 2010, 03:28
ethanlifka ethanlifka is offline
Junior Member
 
Join Date: Aug 2008
Posts: 29
Thanks: 0
Thanked 6 Times in 4 Posts
Default

Sorry, I just turned off my server and I was too tired to turn it back on.

Here are the errors:
/var/log/ispconfig/httpd/test.com/error.log
Code:
[Tue Feb 23 10:11:33 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Tue Feb 23 10:11:33 2010] [error] [client 200.100.0.104] Premature end of script headers: asdf.php
[Tue Feb 23 10:11:33 2010] [error] [client 200.100.0.104] File does not exist: /var/www/error/500.html
/etc/httpd/logs/error_log
Code:
[Tue Feb 23 10:11:33 2010] [notice] mod_fcgid: call /var/www/clients/client0/web7/web/asdf.php with wrapper /var/www/php-fcgi-scripts/web7/.php-fcgi-starter
suexec failure: could not open log file
fopen: Permission denied
[Tue Feb 23 10:11:36 2010] [notice] mod_fcgid: process /var/www/clients/client0/web7/web/asdf.php(2887) exit(communication error), terminated by calling exit(), return code: 1
which file is it refering to?
/etc/httpd/logs/suexec.log is being written to just fine.
Code:
[2010-02-23 10:11:32]: uid: (5003/web7) gid: (5004/5004) cmd: .php-fcgi-starter
[2010-02-23 10:11:32]: uid: (5003/web7) gid: (5004/5004) cmd: .php-fcgi-starter
[2010-02-23 10:11:33]: uid: (5003/web7) gid: (5004/5004) cmd: .php-fcgi-starter
/var/www/php-fcgi-scripts/web7/.php-fcgi-starter
Code:
#!/bin/sh
PHPRC="/etc/"
export PHPRC
PHP_DOCUMENT_ROOT="/var/www/clients/client0/web7"
export PHP_DOCUMENT_ROOT
# The variable PHP_FCGI_CHILDREN is onyl useful for lighty or nginx as apache
# mod_fcgi will control the number of childs themself and never use the additional processes.
# PHP_FCGI_CHILDREN=8
# export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php-cgi \
 -d open_basedir=/var/www/clients/client0/web7 \
-d upload_tmp_dir=/var/www/clients/client0/web7/tmp \
-d session.save_path=/var/www/clients/client0/web7/tmp \
 $1
Thanks

Last edited by ethanlifka; 24th February 2010 at 03:36. Reason: Update
Reply With Quote
  #4  
Old 24th February 2010, 09:21
ethanlifka ethanlifka is offline
Junior Member
 
Join Date: Aug 2008
Posts: 29
Thanks: 0
Thanked 6 Times in 4 Posts
Default

It seems I Commented out
"AddHandler php5-script .php"
"AddType text/html .php"
from /etc/httpd/conf.d/php.conf.

Although the only reason I commented them out was because I was getting the download .php file from the browser, but I guess that was caused by something else.

Thanks

Last edited by ethanlifka; 2nd March 2010 at 09:13.
Reply With Quote
The Following User Says Thank You to ethanlifka For This Useful Post:
falko (24th February 2010)
  #5  
Old 2nd March 2010, 09:23
ethanlifka ethanlifka is offline
Junior Member
 
Join Date: Aug 2008
Posts: 29
Thanks: 0
Thanked 6 Times in 4 Posts
 
Default

SOLVED!

Got the Errors again after I re-uploaded "php-fcgi-starter.master" in the "/usr/local/ispconfig/server/conf" directory.

It seems I can't re-upload these master files with File-Zilla.
I tried in Binary as will, but still get the errors.

FYI, if you change these files you need to save the site you are working on and logout and log back in through ISPC3 for the changes to take affect.

Any chance to have a "Update Sites" button in the Admin.

I did this many times and still got the errors.

I had to revert to a back-up I created using Shell.

Then no more errors.

?
Why wont this file work when transfered though FTP?
?

Anyways I got it working and I created my own php.ini.master file to use for custom php.ini files.
it gets created each time I create a Fast-CGI site.
I made changes to ""/usr/local/ispconfig/server/plugins-enabled/apache2_plugin.inc.php"
It adds functions in "disable_functions", changes the "upload_tmp_dir" to the sites tmp folder and the session.save_path.

It would be nice if there was a "Use Custom PHP.ini File" checkbox when creating a website that would do this automaticly. Even be able to edit it with a Wysiwyg Editor.

Thanks

Last edited by ethanlifka; 2nd March 2010 at 09:38. Reason: solved
Reply With Quote
Reply

Bookmarks

Tags
fast-cgi, suexec failure

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error with suExec + FCGI jado Installation/Configuration 6 24th April 2009 12:43
fastcgi and php with ispconfig tosser Installation/Configuration 14 18th January 2009 13:41
ISPconfig with suexec and fastcgi todvard Tips/Tricks/Mods 7 15th May 2007 10:45
SuExec compiling qtam0 Server Operation 6 24th September 2006 02:25
fastcgi and php with ispconfig tosser Tips/Tricks/Mods 3 25th June 2006 21:01


All times are GMT +2. The time now is 05:12.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.