CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Cannot execute a new script

 



Negrazo49
Novice

Mar 8, 2016, 12:11 PM

Post #1 of 9 (2497 views)
Cannot execute a new script Can't Post

Hello everyone:
I am trying to run the mainmenu.pl script as
localhost:80/taxis/mainmenu.pl

And i am receiving this option:

Opening mainmenu.pl
You have choosen to open: mainmenu.pl bla bla bla
What Firefox should do wit this file?

Opening with perl? or
Saving the file?

The question is what am i doing wrong?

Any help will be really appreciated.
Thanks a lot.


Zhris
Enthusiast

Mar 8, 2016, 5:12 PM

Post #2 of 9 (2456 views)
Re: [Negrazo49] Cannot execute a new script [In reply to] Can't Post

Make sure the user running the script has execute permission.

Check the shebang line (first line) in the script points at your Perl interpreter.

Also check the response header is valid.

Chris


(This post was edited by Zhris on Mar 8, 2016, 5:21 PM)


Laurent_R
Veteran / Moderator

Mar 9, 2016, 3:10 AM

Post #3 of 9 (2388 views)
Re: [Negrazo49] Cannot execute a new script [In reply to] Can't Post

How are you launching this? I mean, from which application?


Negrazo49
Novice

Mar 9, 2016, 5:48 AM

Post #4 of 9 (2372 views)
Re: [Zhris] Cannot execute a new script [In reply to] Can't Post

Thank you Zhris for your answer.
I have permission to execute, the interpreter is in /usr/bin what i have to check is the envvar PATH. May be this is the problem.


Negrazo49
Novice

Mar 9, 2016, 5:50 AM

Post #5 of 9 (2371 views)
Re: [Laurent_R] Cannot execute a new script [In reply to] Can't Post

Hello Laurent.
I am using a browser, especifically Mozilla Firefox,

Http://localhost:80/taxis/indice.pl

What am i doing wrong?


Negrazo49
Novice

Mar 9, 2016, 5:56 AM

Post #6 of 9 (2369 views)
Re: [Negrazo49] Cannot execute a new script [In reply to] Can't Post

The PATH includes /usr/bin , so this is not the problem.
I will keep searching.

I thank you guys for your help.
Negrazo49


FishMonger
Veteran / Moderator

Mar 9, 2016, 9:38 AM

Post #7 of 9 (2357 views)
Re: [Negrazo49] Cannot execute a new script [In reply to] Can't Post

Do you have a web server such as apache installed on your system? If you do, then it's not configured correctly to execute cgi scripts. If you don't have a web server installed, then the browser is not going to know what to do with the script and won;t be able to execute it.


Zhris
Enthusiast

Mar 9, 2016, 5:32 PM

Post #8 of 9 (2347 views)
Re: [Negrazo49] Cannot execute a new script [In reply to] Can't Post

If the execute permission is fine and you still get the download dialog then I suspect what Fishmonger has pointed out, that your server might not be configured properly to execute cgi scripts ( http://httpd.apache.org/docs/current/howto/cgi.html ). If you didn't have a server installed at all, you wouldn't have gotten as far as you have. I mentioned you should also check the response headers because if your script prints a download or unrecognized content type, then it will likely force download, but this of course assumes your script executed successfully.

Chris


(This post was edited by Zhris on Mar 9, 2016, 5:34 PM)


Negrazo49
Novice

Mar 10, 2016, 10:21 AM

Post #9 of 9 (2325 views)
Re: [Zhris] Cannot execute a new script [In reply to] Can't Post

Dear Zhris and fishMonger, i saw your replies and everything you mention is fine. What i think is that Apache2 is not configured properly, i agree totally with you, and i am working on that.
I will keep you posted.

Thanks any way.

Negrazo49

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives