How to make Apache2 ingore the shebang line?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

How to make Apache2 ingore the shebang line?

Postby mayhem » 20. February 2006 19:14

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.
User avatar
mayhem
 
Posts: 6
Joined: 20. February 2006 18:43

Postby Dave_L » 20. February 2006 22:18

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.
User avatar
Dave_L
 
Posts: 212
Joined: 23. October 2004 00:43

Postby mayhem » 20. February 2006 22:31

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?
User avatar
mayhem
 
Posts: 6
Joined: 20. February 2006 18:43

Postby Wiedmann » 20. February 2006 23:38

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.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby mayhem » 20. February 2006 23:46

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".
User avatar
mayhem
 
Posts: 6
Joined: 20. February 2006 18:43

Postby mayhem » 21. February 2006 13:45

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".
User avatar
mayhem
 
Posts: 6
Joined: 20. February 2006 18:43


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 139 guests