Forum Moderators: phranque

Message Too Old, No Replies

Problem with rewritten URLs

         

grunff

3:43 pm on Jan 19, 2005 (gmt 0)

10+ Year Member



Hi all,

One of our sites makes use of an open source shop solution, OSCommerce. One of the features of OSCommerce is that it can rewrite URLs, turning something like:

[yoursite.com...]
into
[yoursite.com...]

The rewriting is done in php, within the OSCommerce application - it doesn't use mod_rewrite.

This site is currently running just fine on a shared server. We've just tried to migrate it to a dedicated server, running much the same setup (FreeBSD and Apache).

The rewritten URLs result in an Internal Server Error (500). The only relevant entry in the log file is:

Premature end of script headers: /execscriptdir/php.cgi

Any idea where I should start looking? Is this an apache config problem or a php config problem? I realise that this isn't much info, but any hints or pointers would be much appreciated.

OS: FreeBSD 4.10
Apache version: 1.3.31
PHP Version: 4.3.10
PHP Running as: CGI

TIA

valder

8:51 pm on Jan 19, 2005 (gmt 0)

10+ Year Member



Hi and welcome to the forums,

You're having trouble with php and not just osCommerce, right?

I won't pretend to be an expert on his, but I have a suggestion or two;

The most obvious suggestion;
Since you're running php as CGI, perhaps your setup requires you to begin all php files with #!<path-to-cgi>

Or perhaps it has something to do with wrong file permissions? You can test it by setting permissions to 777 for a test file.

Eivind

grunff

11:08 pm on Jan 19, 2005 (gmt 0)

10+ Year Member



Thanks for your reply.

PHP is actually running fine - all normal PHP stuff works. The issue is specifically to do with how the server handles it when you call a url like this:
[domain.com...]

The current server serves up index.php, whereas the new server chokes on it, presumably because it looks for a directory called index.php but can't find it.

valder

12:46 pm on Jan 20, 2005 (gmt 0)

10+ Year Member



Perhaps this is more suitable for the php forum.
Anyway, here's another shot in the dark:

Does it help to put this line in your server config/.htaccess?
ForceType application/x-httpd-php

Eivind