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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActivePerl and apache

Status
Not open for further replies.

pho01

Programmer
Mar 17, 2003
218
US
I installed ActivePerl and apache on my windows server box. When i was trying to call a Perl script from the browser, which works perfectly fine from the command line and it's supposed to display the results as html, I get the error "page can not be found" on the browser.

The file is there, but it seems like it can't be executed or something. What's going on?

Thanks,
Phuong
 
Check the permissions of the file and make sure it is 755.
Also make sure that you print the content-type before you
output the data.

N
 
it's a windows file, how do I check for file permission and chmod it?

The thing is that, I tested a popular test script "hello world", it worked fine. It displayed the content of the script "hello world" on the browser. But this script, it used LWP to fetch an internet page and supposed to display its content on the browser, now it said "page could not be found".

I can't figure out why it did that. When I doubleclicked on the file ".pl" extension or opened it from a browser by using IE|File|Open|Browse, it brought up the command line and ran it from there, but did not display anything on the browser.

Thanks!
 
Apache can look for a script in a couple different ways. It can use the first line of the script to point to the location of the interpreter (#! shebang line). It can be told to use the registry to find whatever program is associated to open the file with that extention (.pl .cgi etc).

To run the script, it either needs to be in a script-aliased directory, or have a handler set up for that type of file.

I think all of these things can be set in the apache/conf/httpd.conf configuration file. Also, check the apache forum here at tek-tips. I think there's an FAQ there on setting up apache/perl.

But in the end, the test script worked fine, so these things shouldn't be too much of a problem if you modeled your script after the test script. Most of those things will come back with an internal server error 500.

Do you know if apache is giving you the page not found error, or if the perl script is unable to retrieve the page and is giving you a not found error for that? ----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
I don't know, probably the perl script. When I double click on the file, it brought up the command line and ran the script from there. Probably the same thing when it's opened from a browser. Script is run from the command line, therefore browser understands it as 'Page not Found'.

simple test script is working fine, i wonder why i couldn't be opened from a browser.
 
Is your script in the same directory as the test script? I think apache not found errors will specify the 404 number, and give you a link to e-mail the admin and what-not. It should make itself known.

If you're actually seeing the html of the page you're trying to retrieve when run from the command line, it should get it just as well from the web server/browser. ----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
Yes, it's in the same directory. and I've set Apache to handle .pl file as well.

I generated the html file when it ran from the command line. Another way to open: When I rightclicked on it, and select open from Perl interpreter, it works fine. When I selected internet explorer, it didn't display the page, it splashed, and nothing happened.

anybody had this issue?
Thanks
 
please see faq452-872

There are a couple of other faqs in the cgi forum that may be helpful.

'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top