Hi,
first I am new to this but have tried to cure this problem.
I created a simple PHP file called test.pl which is lsited as follows:-
#!/usr/bin/perl
print "thank god this works!\n";
I uploaded it to my hoster where it resides:-
created a web page with a link to the file "http://www.edwards-micros.co.uk/cgi-bin/test.pl"
If I use putty to get into my site and type ./test.pl the file runs however if I use my link I get a server error and the server log says header errors.
Sorry to be so long winded but my question is is the fault on the server of the script.
I typed perl where and the #!/usr/bin/perl is correct.
I contacted the hoster who basicaly said go away.
I used putty to chmod the files and directory to 777 but it still doesn't work.
Does anyone have any ideas?
thanks
Ian
PHP and Unix not running
Moderator: General Moderators
-
TheBentinel.com
- Forum Contributor
- Posts: 282
- Joined: Wed Mar 10, 2004 1:52 pm
- Location: Columbus, Ohio
Re: PHP and Unix not running
That's a perl script, which you would access through cgi. You're getting the error because there has to be a content-type header, or something like that. Straight CGI is a pain...jenodorf wrote: I created a simple PHP file called test.pl which is lsited as follows:-
#!/usr/bin/perl
print "thank god this works!\n";
created a web page with a link to the file "http://www.edwards-micros.co.uk/cgi-bin/test.pl"
To make it a PHP script, change it to:
<?php
print("it worked!<br>");
?>
call it test.php and drop it in your root directory, not your cgi-bin directory. Then you can link it from:
http://www.edwards-micros.co.uk/test.php
Hope it helps!