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: Advanced:
perl problem or apache problem??

 



entius
stranger

Jul 23, 2002, 7:16 AM

Post #1 of 9 (1868 views)
perl problem or apache problem?? Can't Post

Ok, i've decided to post my post here, in the advance section, just because i really think this is a rare problem not easy to resolve:

I'm moreless new in linux world, all i wanted to do was to install apache 2 in suse 8, and run the server.
The problem is this: i can see the html pages, but i cannot execute my perl scripts.
Stop thinking about typical mistakes, all i can get is the error 'premature end of scripts ...' Mad but that's not all.
Two-three hours after i watch by casuality \r\n in a script and i though "that's it, my Content ... \n\n has to be Content ... \r\n\r\n" and it WORKED Cool and everything was allright, all my scripts run perfectly!!!!
I went to sleep but today, oh today, today i have the same problem "premature end ...", the \r\n\r\n was only valid for one day! Shocked it begins to self-convert in a rare-case, doesn't it?
I catched my test.pl script (of course 755 - really 777)(of course working in console) and i began to prove things.
The surprise was to comprove that if i let the file empty, this is a blank file called test.pl, the same sentence was shown!! i though, maybe apache is not reading the file? yes yes, if you put localhost/test2.pl then apache says "i can't find this file", so, the only solution is a cache problem, but i really don't think this.
Any bug of apache?
Any mistake of mine in apache conf?
Am i doing any mistake???
Why yesterday everything worked well???????Crazy

I guess you wanted to view the complex test.pl i was proving, ok, here there is:

#!/usr/bin/perl -w

print "Content-type: text/html \r\n\r\n";
print "\r\n\r\nhola";
$| = 1;

And you can bet 100 euros perl is in /usr/bin/perl

Any idea???UnsureFrown
blogum


Jean
User


Jul 23, 2002, 9:14 AM

Post #2 of 9 (1864 views)
Re: [entius] perl problem or apache problem?? [In reply to] Can't Post

I'm not a pro in CGI, but it'sa probably mod_perl (which requires httpd restart to refresh the script contents) defined in apache.
Restart the httpd and if it's working, then it's mod_perl
Another option - try renaming test.pl to some other name and run the new file - it won't be cached...


Jean Spector
SQA Engineer @ Exanet
jean.spector@softhome.net


There are only 10 types of people in the world -
Those who understand binary, and those who don't.


(This post was edited by Jean on Jul 23, 2002, 9:16 AM)


entius
stranger

Jul 23, 2002, 11:22 AM

Post #3 of 9 (1858 views)
no, it's not this :( [In reply to] Can't Post

Good idea to change name, i've tried but it doesn't works Unsure

I don't understand very well what you say about mod_perl (i haven't touched this YET and i believe this is not installed) but i've restarted a lot of times and nothing, 2 minutes ago i've tried again but nope, problem persists.

Thanks anyway, of course Blush

Any other idea? this is my last defense line, and i think maybe is that apache 2 is not still oficial, and i guess i will install apache 1.3x and pray Frown

What i really doesn,t understand is, why it worked during few hours????? why then it returned back????
blogum


Paul
Enthusiast

Jul 23, 2002, 12:15 PM

Post #4 of 9 (1857 views)
Re: [entius] no, it's not this :( [In reply to] Can't Post

I'd stick with Apache 1.3.24 and mod_perl 1.26/1.27 for the moment. Apache 2 and mod_perl 1.99 have a few things to be ironed out yet...you'll save yourself a lot of headaches.


entius
stranger

Jul 23, 2002, 11:27 PM

Post #5 of 9 (1849 views)
Re: [RedRum] no, it's not this :( [In reply to] Can't Post

just another question, why i can change freely the first line #!/usr/bin/perl and apache say nothing??? what is then the problem??
blogum


Jean
User


Jul 24, 2002, 12:32 AM

Post #6 of 9 (1848 views)
Re: [entius] no, it's not this :( [In reply to] Can't Post

In case you're running under M$ Windows, apache can be defined to run the interpreter according to registry settings - then the shebang (#!...) will be ignored...


Jean Spector
SQA Engineer @ Exanet
jean.spector@softhome.net


There are only 10 types of people in the world -
Those who understand binary, and those who don't.


(This post was edited by Jean on Jul 24, 2002, 12:33 AM)


entius
stranger

Jul 24, 2002, 1:06 AM

Post #7 of 9 (1844 views)
Re: [Jean] no, it's not this :( [In reply to] Can't Post

no, i'm under suse 8.0, i've released that the problem is sure apache, he's not able to execute scripts (neither the simple printenv that comes in cgi-bin by example).
Now i'm installing apache 1.3.9, i wish i'll have no problem with this :)
blogum


Jean
User


Jul 24, 2002, 1:18 AM

Post #8 of 9 (1841 views)
Re: [entius] no, it's not this :( [In reply to] Can't Post

Good luck then Smile


Jean Spector
SQA Engineer @ Exanet
jean.spector@softhome.net


There are only 10 types of people in the world -
Those who understand binary, and those who don't.


entius
stranger

Jul 24, 2002, 1:18 AM

Post #9 of 9 (1840 views)
Re: [entius] no, it's not this :( [In reply to] Can't Post

now with apache 1.3.9 i get the same message but before this one:

Permission denied: exec of /..../perl/test2.pl failed

But the file permision is 755 and the directory is a cgi-bin directory
The same message is shown with the /cgi-bin/printenv of apache

Any idea???
blogum

 
 


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

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