I'm a PHP programmer, 4 years so I know what I'm doing, but my work has been limited to *nix servers, and now I need to write code for a WinNT system, with PHP installed as a CGI binary.
I'm writing a site for a client who doesn't have shell access, and their tech support people have NO input on this.. simply mind boggling. After admitting that my script is error free, they tell me they have "no information" on getting it to process. So, I'm turning to others who may have info.
Here's my issue: I can't make their server understand that it needs to process my script as PHP. I'm told I don't need to shell escape the script by using #!/usr/bin/php as the first line (and since I "don't need it" they won't verify that it's a correct path) but I've tried it anyway, with and without the line. I've tried using forward slashes as well, since it's a windows system.
My script:
#!/usr/bin/php
<?
print "Hello World";
?>
I get this error message:
Unterminated <> operator at d:\html\users\xxx\html\test.pl line 2.
I've tried changing the path (guessing at it), removing that line entirely, still nothing. By putting the entire PHP script on one line, since the php tag is confusing it, i.e.:
#!/usr/bin/php
<? print "Hello World"; ?>
I lose the unterminated operator error but now get:
'd:\html\users\xxx\html\test.pl' script produced no output
The server just isn't recognizing that the page contains PHP commands. Plus, I won't write a web site that can't have line breaks in the code! 🙂 I've tried using long tags (<?php), tried various extensions.. was told by tech support that .pl or .plx would work, but have also tried .php and .cgi. I would try chmoding the file, but it's a windows system, everything is always rwxrwxrwx.
Does anyone know how to tell a WinNT system with PHP installed as a CGI binary that a file needs to be processed as PHP? Would anyone have a sample script that processes some PHP in that set up? I would REALLY appreciate any help! I've been through every manual and forum I can find, and tried tons of possible solutions, but none have resulted in a simple processing of PHP. Sorry to go on and on, I just want you to know what I've already tried.
Thanks much,
Steph