PDA

View Full Version : Only Fast-CGI works


NeeChee
3rd August 2009, 19:54
I've been looking for a solution to this. Whenever I set a site's PHP mode to anything other than Fast-CGI (CGI/Mod-PHP/SuPHP) the site returns an 500 error.

I found out because I tried to override PHP settings with an htaccess (max filesize upload) which wouldn't work for me. (Help with that would be appreciated as well)

till
4th August 2009, 08:53
Look in the error log of the website, you will find the reason for the error explained there.

NeeChee
4th August 2009, 18:11
I have looked into the errorlogs before I posted my problem here, the only thing I could find in the apache log was a
[warn] long lost child came home! (pid ...)
and
[warn] (103)Software caused connection abort: mod_fcgid: ap_pass_brigade failed in handle_request function

other than that... nothing.

till
5th August 2009, 09:27
You have to lookm into the error log of the website and not the general apache log!

NeeChee
5th August 2009, 11:01
I checked both, upper warn came from general, lower one from site specific one.

Edit:
I now got some additional errors from trying again:

[Wed Aug 05 09:06:49 2009] [alert] [client ***.***.***.***] /****************/.htaccess: php_flag not allowed here


EDIT2:

I've now narrowed it down to my .htaccess file. The server will return 500 errors if I use php_flag of php_value in my .htaccess file. Below a copy of the .htaccess file causing trouble.


# AddDefaultCharset UTF-8
AddType text/x-component .htc

<IfModule mod_php5.c>
php_flag display_errors Off
php_flag log_errors On
php_value error_log logs/errors

php_value upload_max_filesize 5M
php_value post_max_size 6M
php_value memory_limit 64M

php_value zlib.output_compression 0
php_value magic_quotes_gpc 0
php_value zend.ze1_compatibility_mode 0

php_value session.auto_start 0
php_value session.gc_maxlifetime 21600
php_value session.gc_divisor 500
php_value session.gc_probability 1

php_value mbstring.func_overload 0
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^favicon.ico$ skins/default/images/favicon.ico
</IfModule>

Order deny,allow

till
6th August 2009, 09:10
php_flag and php_value can only be used for mod_php and have to be moved to the apache directives field of the website then as they are forbidden for .htaccess files.

NeeChee
6th August 2009, 10:55
Thanks very much, everything seems to work fine now. However I was wondering if I could set the php_flag and php_value for specific folders in my website.

till
6th August 2009, 11:01
However I was wondering if I could set the php_flag and php_value for specific folders in my website.

No, these settings are always website wide.

NeeChee
6th August 2009, 11:42
Isn't there any way to make directory specific php_flags and values?

till
6th August 2009, 11:49
Not as far as I know. If you run different software, you should make a new website for every application and do not install them in the same website.

NeeChee
6th August 2009, 11:52
Okay, then thanks for all your help! I know I've been a pain in the a**! xD

BorderAmigos
12th February 2010, 22:35
I uses php_value in my .htaccess files and it works.

<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
php_value output_buffering On
php_value output_handler mb_output_handler
php_value log_errors 1
</IfModule>



EDIT: It works with suPHP. It may not with CGI or Fast-CGI.