Page 1 of 1

How to make Apache2 ingore the shebang line?

PostPosted: 20. February 2006 19:14
by mayhem
Is there a way to tell Apache2 to ignore shebang line? I need to write PHP code on my Windows machine (xampp-win32-1.5.1 on Windows XP SP2) and publish it on a web server under Linux with mandatory #!/usr/local/bin/php at the begining of each PHP file.

I've played with Windows Registry and ScriptInterpreterSource in httpd.conf, later saw that XAMPP-Apache2 uses PHP as a module and tried to switch it to CGI mode from apache/conf/extra/httpd-xampp.conf, but with no success (I'm not really into Apache/PHP administration) — the damn shebang line always gets shown in browser on Windows.

PostPosted: 20. February 2006 22:18
by Dave_L
Is the #! line terminated with a LF (Unix line terminator), rather than a CR-LF (Windows line terminator)? That could be why Windows is displaying the line.

PostPosted: 20. February 2006 22:31
by mayhem
Yes it is, but it needs to be that way because of the Linux web server. Anyway, the line shows up even with CR-LF. It's really annoying, not only it breaks completely my CSS layout but also all the scripts that do some HTTP header processing. Could someone help please?

PostPosted: 20. February 2006 23:38
by Wiedmann
Is there a way to tell Apache2 to ignore shebang line? I need to write PHP code on my Windows machine (xampp-win32-1.5.1 on Windows XP SP2) and publish it on a web server under Linux with mandatory #!/usr/local/bin/php at the begining of each PHP file.

Then you must configure an use PHP as CGI and not with the Apache module, as on your Linux box.

PostPosted: 20. February 2006 23:46
by mayhem
It's not my Linux box actually, but I tried to configure Apache2 on Windows to run PHP as CGI instead of module — commented out LoadModule line and uncommented ScriptAlias and Action lines from $xampp\apache\conf\extra\httpd-xampp.conf. Now I do get "Error 403 Forbidden".

PostPosted: 21. February 2006 13:45
by mayhem
The exact error I'm getting in Apache log is "[error] [client 127.0.0.1] client denied by server configuration: S:/apps/xampp/php/php-cgi.exe".