Help Running Perl Scripts from a web-page 
Author Message
 Help Running Perl Scripts from a web-page

Here is a simple script that I wrote in Perl. It works fine when I run it from
the Perl Interpreter on my machine, but when I upload it to the net it doesn't.

#!\usr\bin\perl
print "Content-type: text/html\n\n";
print "\n\n";

print "Hello World";

I uploaded the file into the cgi-bin given to me by my web-host, but everytime
I go to the file either by typing the exact loc into my browser or thorough
another HTML form, it gives me a 500 Internal Server error.

Here is a link to the problem script...

 <A HREF = " http://www.*-*-*.com/ ;> Problem Script
</A>

Can anyone help?

Thank in advance,
Falc



Sat, 02 Aug 2003 08:40:31 GMT  
 Help Running Perl Scripts from a web-page
Hi there,

These are the first things I can think of...

1) Did you upload your perl program as ASCII text?
2) Did you change permissions ( chmod ) on your perl program to 755 after you
uploaded it?
3) Make sure perl is where the shebang line says it is
4) You're missing the basic minimum HTML tags to create an HTML page (
<HTML><HEAD> etc )

These are just guesses as I don't know all of the details.  Try these and please
let me know if any work for you.

ted

Quote:

> Here is a simple script that I wrote in Perl. It works fine when I run it from
> the Perl Interpreter on my machine, but when I upload it to the net it doesn't.

> #!\usr\bin\perl
> print "Content-type: text/html\n\n";
> print "\n\n";

> print "Hello World";

> I uploaded the file into the cgi-bin given to me by my web-host, but everytime
> I go to the file either by typing the exact loc into my browser or thorough
> another HTML form, it gives me a 500 Internal Server error.

> Here is a link to the problem script...

>  <A HREF = "http://odin.prohosting.com/falc/cgi-bin/test1.cgi"> Problem Script
> </A>

> Can anyone help?

> Thank in advance,
> Falc



Sat, 02 Aug 2003 08:52:23 GMT  
 Help Running Perl Scripts from a web-page
Do you have a server error log file? If so what does this error say.
hth
newuser
Quote:

>Here is a simple script that I wrote in Perl. It works fine when I run it
from
>the Perl Interpreter on my machine, but when I upload it to the net it
doesn't.

>#!\usr\bin\perl
>print "Content-type: text/html\n\n";
>print "\n\n";

>print "Hello World";

>I uploaded the file into the cgi-bin given to me by my web-host, but
everytime
>I go to the file either by typing the exact loc into my browser or thorough
>another HTML form, it gives me a 500 Internal Server error.

>Here is a link to the problem script...

> <A HREF = "http://odin.prohosting.com/falc/cgi-bin/test1.cgi"> Problem
Script
></A>

>Can anyone help?

>Thank in advance,
>Falc



Sat, 02 Aug 2003 08:56:49 GMT  
 Help Running Perl Scripts from a web-page


Quote:
> Here is a simple script that I wrote in Perl. It works fine when I run it
from
> the Perl Interpreter on my machine, but when I upload it to the net it
doesn't.

> #!\usr\bin\perl

I kind of doubt that's the real location of perl. Maybe #!/usr/bin/perl ?
Maybe #!c:\some\ms\path\perl.exe ?

Quote:
> print "Content-type: text/html\n\n";
> print "\n\n";

> print "Hello World";

> I uploaded the file into the cgi-bin given to me by my web-host, but
everytime
> I go to the file either by typing the exact loc into my browser or
thorough
> another HTML form, it gives me a 500 Internal Server error.

> Here is a link to the problem script...

>  <A HREF = "http://odin.prohosting.com/falc/cgi-bin/test1.cgi"> Problem
Script
> </A>

> Can anyone help?

> Thank in advance,
> Falc



Sat, 02 Aug 2003 09:21:51 GMT  
 Help Running Perl Scripts from a web-page


Quote:
> Here is a simple script that I wrote in Perl. It works fine when I run it
from
> the Perl Interpreter on my machine, but when I upload it to the net it
doesn't.

> #!\usr\bin\perl
> print "Content-type: text/html\n\n";
> print "\n\n";

> print "Hello World";

> I uploaded the file into the cgi-bin given to me by my web-host, but
everytime
> I go to the file either by typing the exact loc into my browser or
thorough
> another HTML form, it gives me a 500 Internal Server error.

> Here is a link to the problem script...

>  <A HREF = "http://odin.prohosting.com/falc/cgi-bin/test1.cgi"> Problem
Script
> </A>

Not really a Perl question, but you need to replace

#!\usr\bin\perl

with

#!/usr/bin/perl



Sat, 02 Aug 2003 09:16:27 GMT  
 Help Running Perl Scripts from a web-page

Quote:
>1) Did you upload your perl program as ASCII text?
>2) Did you change permissions ( chmod ) on your perl program to 755 after you
>uploaded it?
>3) Make sure perl is where the shebang line says it is
>4) You're missing the basic minimum HTML tags to create an HTML

I am sure I got 1,3, and 4 covered. The only problem is changing the
permissions.
I am writing my scripts on a Windows platform, so I don't have to worry about
it then.Only when my web-host runs my script on a UNIX server do they come into
play.

 I am not sure how you change permissions with my FTP service, if that is even
where you change it.

Can you point me in the direction of a free FTP app where you know how to
change permissions, so you can tell me how it is done.

Thanks,
Jehan



Sat, 02 Aug 2003 23:30:46 GMT  
 Help Running Perl Scripts from a web-page
I don't know if it's free, but I'm pretty sure you can get at least a shareware
version of WS_FTP from http://www.tucows.com.  After you upload your perl script
to the server, highlight it on the server side of WS_FTP, right click, and select
"UNIX chmod" from the menu.  It will then ask you what permissions you'd like to
give the file.  Select all three for owner, read & execute for group, and read &
execute for world.  HOWEVER, depending on how the server is configured, this
sometimes doesn't work.  If it doesn't, the only other things I can suggest is to
telnet to your server and chmod it from the command line.  I don't use AOL so I
don't know if this is possible.  If that doesn't work, you may have to call AOL
and have them set the permissions for you.  Again, I don't know if AOL does this
kind of thing.

Also, another respondent pointed out a problem with wrong-facing slashes in your
shebang line.  I completely missed that!

Hope you get it working.  Please let me know what happens.

ted

Quote:

> >1) Did you upload your perl program as ASCII text?
> >2) Did you change permissions ( chmod ) on your perl program to 755 after you
> >uploaded it?
> >3) Make sure perl is where the shebang line says it is
> >4) You're missing the basic minimum HTML tags to create an HTML

> I am sure I got 1,3, and 4 covered. The only problem is changing the
> permissions.
> I am writing my scripts on a Windows platform, so I don't have to worry about
> it then.Only when my web-host runs my script on a UNIX server do they come into
> play.

>  I am not sure how you change permissions with my FTP service, if that is even
> where you change it.

> Can you point me in the direction of a free FTP app where you know how to
> change permissions, so you can tell me how it is done.

> Thanks,
> Jehan



Sun, 03 Aug 2003 05:33:34 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. running a batch file with perl script througha web page

2. Server side includes to run Perl scripts from web pages

3. Running Perl Script from HTML Web page

4. Help! - Starting perl scripts from within Web Pages

5. help page refresh runs the script again !

6. please help - cgi database access script / program for web page

7. perl script for calling a java program,running the script through cgi of the web server

8. How to call a perl script or web page from within perl

9. Trouble getting to run from web page

10. Q: how to run a simple CGI on web page

11. ANNOUNCE: PGPHTML 3.0: a perl script to make PGP signed web-pages

 

 
Powered by phpBB® Forum Software