| Forum Home | ||||
| Press F1 | ||||
| Thread ID: 59882 | 2005-07-15 05:51:00 | CGI/Perl Problem | Brian (1043) | Press F1 |
| Post ID | Timestamp | Content | User | ||
| 372467 | 2005-07-15 05:51:00 | Hi there! :help: I am just starting out learning CGI/Perl and have a, I hope, simple problem . I have uploaded the following script to my website (it is hosted on a Windows 2003 server), yet when I go to the the site, it doesn't frun (i . e . a "Page cannot be found" message is returned) . I was wondering if someone can help me discover what I am doing wrong :waughh: . Here is the script: #!/usr/local/user/perl #hello . pl - my first perl script! print "Content-type: text/html\n\n"; print <<"EOF"; <HTML> <HEAD> <TITLE>Hello, world!</TITLE> </HEAD> <BODY> <H1>Hello, world!</H1> </HTML> EOF I save the file as both "hello . pl" and "hello . cgi" and then go to my website and go to cgi-bin and the extension (i . e I go to the following: www . god-zone . org . nz/cgi-bin/hello . pl I have also tried www . god-zone . org . nz/cgi-bin/hello . cgi but I get the "Page not found" message . ) Can anyone please help out this confused newbie! Thanx :thumbs: |
Brian (1043) | ||
| 372468 | 2005-07-15 06:09:00 | Check the permissions on all files CGI scripts are a pain in the neck (for me anyway, I always seem to have trouble with them) I've been trying to get a new script to run for 2 days now and I'm still having bother suExec will throw an internal server error when it considers that permissions are are too loosely set. You must chmod CGI files to 755 It sounds more like the paths in your script are are fault though. Check the URL settings and the absolute and http paths to your file(s) Also check that perl is working on the server correctly and the correct version is installed to run your script Try perl -e `print $]` from the telnet command line |
bartsdadhomer (80) | ||
| 372469 | 2005-07-16 02:24:00 | Hi bartsdadhomer! Thanks for your reply! Can you tell me how I can check file permissions . . . the host server is, as I stated in my original post, a Windows 2003 server and therefore Unix commands are useless . . . any other ideas? Thanx, |
Brian (1043) | ||
| 372470 | 2005-07-16 02:34:00 | sorry Brian, my experience is limited to Unix servers only but apparently you don't need to set permissions on windows servers might pay to contact your host or cruise their faqs |
bartsdadhomer (80) | ||
| 372471 | 2005-07-16 03:19:00 | who are u hosted with and I'll have a look to see if there is anything obvious you might have missed | bartsdadhomer (80) | ||
| 372472 | 2005-07-16 04:35:00 | Hi there bartsdadhomer! Once again I want to thank you for your reply...I am hosted on a server that is run by a friend of mine (he has a website called "Orari Web Design")..he reckons that CGI/Perl has been superceded by asp and .net...the server is one that he has set up and is running...what inforamtion do you need in order to check out my screwed up CGI page? Let me know! Thanx :thumbs: |
Brian (1043) | ||
| 372473 | 2005-07-16 05:10:00 | Because CGI involves running real code on the server, there are usually security settings which stop it by default . ;) I don't know about the MS web server, but I wonder if it has a perl interpreter in a /usr/local/user directory . ;) Your script is looking for it there . You have made your own cgi-bin directory, and put your script there, but I don't think that you can call it directly in the way indicated in your links . I think you need a standard HTML page which is callable from outside, which then calls the perl script by some means . I'm pretty sure that you can't invoke code directly in a URL . That is guaranteed to cause tears before bedtime . I might be totally wrong; I've never bothered with such things much . ;) |
Graham L (2) | ||
| 1 | |||||