Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running Perl CGI on apache - The page cannot be displayed

Status
Not open for further replies.

toadfish

Programmer
Nov 5, 2002
4
GB
This error is occurring on my ISPs webserver. It does not occur with the same script on my local machine or our webservers in the office.

To get me started the ISP created the following script :

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print &quot;<HTML><HEAD>&quot;;
print &quot;<TITLE>CGI Test</TITLE>&quot;;
print &quot;</HEAD>&quot;;
print &quot;<BODY><H2>I just wrote a web page using Perl!</H2>&quot;;
print &quot;</BODY></HTML>&quot;;

this worked fine on all servers. So I ftp'd it back to the local machine and made a minor change to the printed string, tested it on my local machine (fine) and ftp'd it back onto their (unix) server. At this point I get the HTTP 500 error : The page cannot be displayed.

#!/usr/bin/perl
print &quot;Content-type: text/html\n\n&quot;;
print &quot;<HTML><HEAD>&quot;;
print &quot;<TITLE>CGI Test</TITLE>&quot;;
print &quot;</HEAD>&quot;;
print &quot;<BODY><H2>I just wrote a web page using Perl!</H2>&quot;;
print &quot;<H3>No really its fine!</H3>&quot;; # new line here
print &quot;</BODY></HTML>&quot;;

I have chmod'ed the script (correctly I think) to 775. Anyway, if the permissions are incorrect I would get : HTTP Error 403 - Forbidden.

Any new script I create gives the HTTP 500 error : The page cannot be displayed.

So I think its a setup issue or a win/unix problem. My ISP is losing patience as they are not supposed to provide CGI support. To rub salt in the wound I have set up my own production webservers at work using Oracle/apache/PL/SQL and had no problems running scripts. I am new to perl however. Please HELP!
 
Yes definitely in ascii mode. WS_FTP has a view file feature to look at the remote site and it would appear that the codes not been scambled or anything. That was one of the first things I though of too!
 
Check out the two scripts I posted. The first one works when uploaded by the ISP. I then modified it and copied it back. Now I get the errors I mentioned.

(This would suggest the perl path is fine) Isn't /usr/bin/perl normal on UNIX anyways?
 
Hi mate,

Sorry, I misread your post, I thought it worked remotely and not locally.

Because the second script only has one difference ffrom the original, it is obvious that the error is within that line.

From your second script, really its fine.

Is the post above an exact copy or did you re-type it?

I would guess but may be wrong that the problem is with quotes because you have something like really it's fine

Hope this helps Wullie

sales@freshlookdesign.co.uk

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
I get an error like whatever change I make the script, even just one character. I'm pretty sure its some kind of setup issue, as the ISP has copied the file across and it executes without probs. I do it and I get the error!

Cheers
 
Hi mate,

Upload the following and try that.

Code:
#!/usr/bin/perl
print &quot;Content-type: text/html\n\n&quot;;
print &quot;Cgi is working.\n&quot; ;

Hope this helps Wullie

sales@freshlookdesign.co.uk

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top