Forum Moderators: phranque

Message Too Old, No Replies

Mod rewrite & PHP CGI

Problem with mod_rewrite and php together

         

TiNik

11:14 pm on Feb 1, 2010 (gmt 0)

10+ Year Member



Hello,

I don't know how to get my CGI PHP with mod_rewrite. When I try ordinary HTML everything works, but php ends with 500 Internal Server Error.


ScriptAlias /fcgi-bin/ /data/domains/example.com/www/cgi-bin/
AddHandler php-cgi .php
Action php-cgi /fcgi-bin/php
#
#mod_rewrite
RewriteEngine on
RewriteRule page\.php /index.php




error log:

[rid#9296100/initial] (2) init rewrite engine with requested uri /page.php
[rid#9296100/initial] (3) applying pattern 'page\.php' to uri '/page.php'
[rid#9296100/initial] (2) rewrite '/page.php' -> '/index.php'
[rid#9296100/initial] (2) local path result: /index.php
[rid#9296100/initial] (2) prefixed with document_root to /data/domains/example.com/www/index.php
[rid#9296100/initial] (1) go-ahead with /data/domains/example.com/www/index.php [OK]
[rid#929a2e8/initial/redir#1] (2) init rewrite engine with requested uri /fcgi-bin/php/page.php
[rid#929a2e8/initial/redir#1] (3) applying pattern 'page\.php' to uri '/fcgi-bin/php/page.php'
[rid#929a2e8/initial/redir#1] (2) rewrite '/fcgi-bin/php/page.php' -> '/index.php'
[rid#929a2e8/initial/redir#1] (2) local path result: /index.php
[rid#929a2e8/initial/redir#1] (2) prefixed with document_root to /data/domains/example.com/www/index.php
[rid#929a2e8/initial/redir#1] (1) go-ahead with /data/domains/example.com/www/index.php [OK]
[rid#9296100/initial] (2) init rewrite engine with requested uri /
[rid#9296100/initial] (3) applying pattern 'page\.php' to uri '/'
[rid#9296100/initial] (1) pass through /
[rid#929a170/subreq] (2) init rewrite engine with requested uri /index.html
[rid#929a170/subreq] (3) applying pattern 'page\.php' to uri '/index.html'
[rid#929a170/subreq] (1) pass through /index.html
[rid#929a170/subreq] (2) init rewrite engine with requested uri /index.php
[rid#929a170/subreq] (3) applying pattern 'page\.php' to uri '/index.php'
[rid#929a170/subreq] (1) pass through /index.php
[rid#929c138/initial/redir#1] (2) init rewrite engine with requested uri /fcgi-bin/php/index.php
[rid#929c138/initial/redir#1] (3) applying pattern 'page\.php' to uri '/fcgi-bin/php/index.php'
[rid#929c138/initial/redir#1] (1) pass through /fcgi-bin/php/index.php
[rid#92aa1a0/subreq] (2) init rewrite engine with requested uri /index.php
[rid#92aa1a0/subreq] (3) applying pattern 'page\.php' to uri '/index.php'
[rid#92aa1a0/subreq] (1) pass through /index.php

[edited by: jdMorgan at 11:27 pm (utc) on Feb. 1, 2010]
[edit reason] example.com [/edit]

jdMorgan

11:30 pm on Feb 1, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It might be helpful to check --and possibly post-- the relevant entries in your server error log.

Jim

TiNik

11:36 pm on Feb 1, 2010 (gmt 0)

10+ Year Member



Apache error_log:

[error] FastCGI: comm with (dynamic) server "/data/domains/example.com/www/index.php" aborted: (first read) idle timeout (60 sec)
[error] FastCGI: incomplete headers (0 bytes) received from server "/data/domains/example.com/www/index.php"

jdMorgan

2:10 pm on Feb 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't see any relationship between the logged error and the code you've posted. Hopefully, someone with sharper eyes will come along and be able to offer you something useful...

Jim

TiNik

9:13 pm on Feb 3, 2010 (gmt 0)

10+ Year Member



Ok, I'll try asking somewhere else.
Thanks for the effort