469,328 Members | 1,324 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

I'm a total novice - please help - File not found!

6
I hope that you don't get too offended by the stupidity of my question - but I wasn't sure where else to go.

Basically, I'm not a programmer but I have a website which was set up by an internet designer company that has now closed down! It is hosted on a server which is not our own but one of these webhosting servers that you can pay.

Basically, I need to change a page with an html form (i'm ok with limited html code) which links to a perl programme sitting in a cgi-bin.

I run windows xp pro on my own system and I understand that the website's server is probably UNIX (though I don't know how I would go about being sure). I have managed to download perl on to my computer and run a 'hello world' program using the dos window. I have uploaded on to the web server the html version of the hello world program (which I got from here: http://perl.about.com/od/perltutorials/a/hellocgi.htm) using Core FTP and changed the permissions so that anyone can read/write/execute. When I try and look for it on the web it says 'File not found' & "The requested URL was not found on this server"

I'm sure I'm doing something really silly or it might be that I have to call the people that host the site to ask them about permissions?

Thank you for reading and any help you might be able to offer.
Jan 26 '07 #1
8 5782
KevinADC
4,059 Expert 2GB
OK, what that code is, is it's a simple perl script, not an html document:

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. print "Content-type: text/html\n\n";
  3. print <<HTML;
  4. <html>
  5. <head>
  6. <title>A Simple Perl CGI</title>
  7. </head>
  8. <body>
  9. <h1>A Simple Perl CGI</h1>
  10. <p>Hello World</p>
  11. </body>
  12. HTML
  13. exit;
  14.  
you would save it as "test.pl" or "test.cgi" or any other name you prefer. Upload it into the cgi-bin folder of your hosted website using your FTP program in ASCII (or text) mode to transfer the file from your computer to the webserver. See the help files of your FTP client if you are unsure about how to set the transfer mode. The using your FTP client set the permission (chmod) of the test.pl file to 755 (rwxr-xr-x). See the help files of yout FTP client for chmod if necessary. Then you access the script from the url in your browser:

www.yoursite.com/cgi-bin/test.pl

and hopefully is prints "Hello World" in the browser.
Jan 26 '07 #2
tik33
6
Thanks Kevin,

I have tried all that and when I go to my site and type the url of the file (hello1.pl) the message is still saying 'file not found'.

reuploaded - changed permissions, still stuck.

Any further ideas?

Thanks a lot for your time,

Gus
Jan 28 '07 #3
KevinADC
4,059 Expert 2GB
have you spelled the name of the file correctly in the browser? Whats the name of your website and whats the name of the file?
Jan 28 '07 #4
tik33
6
the website is www.solidspace.co.uk and I have put the file called hello1.pl in /web/cgi-bin/ and in /web/ to see if it makes any difference.

when I go to www.solidspace.co.uk/web/hello1.pl it tells me that there is no file found, however, when I miss out /web/ it tells me a different error message:

"CGIWrap encountered an error while attempting to execute this script:

Error Message: Permission denied
Error Number: 13

This message usually indicates there is a problem with the script itself. Often this indicates either that the #! line of the script is incorrect, or the script was uploaded in binary mode instead of ascii mode. Check to make sure that the script does not have control-M's at the end of every line. That will prevent it from executing. An easy fix that takes care of this most of the time is to put '#!/.../perl --' instead of '#!/.../perl' on the first line of the script. This is typically a problem if the script was edited or uploaded from a DOS/Windows/Macintosh station to a unix based server."

are we getting somewhere???

Thanks Kevin.
Jan 29 '07 #5
KevinADC
4,059 Expert 2GB
your files are here:

http://www.solidspace.co.uk/cgi-bin/

"web" is probably the root folder of your site, which is "http://www.solidspace.co.uk", you don't include it in the url.

Make sure you have followed the suggestions in the message:

This message usually indicates there is a problem with the script itself. Often this indicates either that the #! line of the script is incorrect, or the script was uploaded in binary mode instead of ascii mode.


Check to make sure that the script does not have control-M's at the end of every line. That will prevent it from executing. An easy fix that takes care of this most of the time is to put '#!/.../perl --' instead of '#!/.../perl' on the first line of the script. This is typically a problem if the script was edited or uploaded from a DOS/Windows/Macintosh station to a unix based server.
if you are sure you have, you will need to contact tech support and ask them what the problem is.
Jan 29 '07 #6
tik33
6
Thanks Kevin,

I have tried all that - when you say tech support - do you mean the tech support of the web hoster?

Best,

Gus
Jan 31 '07 #7
tik33
6
Kevin,

Just tried again and it worked!

I think it must have something to do with the way I am editing the file in windows (I am using notepad).

Thanks for your help - really appreciate it - now I've got to try and make the others work!

Best, Gus
Jan 31 '07 #8
tik33
6
Just an update - have got everything to work!

just for others that want to try this and are working in windows uploading to a UNIX server:

Write the file in the notepad.

When you save, use 'save as'.

File name box: Type the name of the file eg. test and add a .pl extension - so test.pl

Save as type box: Change the save as type from text file to 'all files'

Encoding box: Use Ansii.

then follow Kevin's instructions to upload using Ansii and change permissions (rightclick on the file name does it with CoreFTP).

That then worked for me - so if you're having a similar problem - try that!

Best, Gus
Jan 31 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Ewa | last post: by
5 posts views Thread by fwells11 | last post: by
10 posts views Thread by giancarlodirisioster | last post: by
76 posts views Thread by Alan Connor | last post: by
2 posts views Thread by sean | last post: by
5 posts views Thread by simondsm | last post: by
23 posts views Thread by casper christensen | last post: by
1 post views Thread by txguy | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.