From: Harikrishnan B. <har...@jp...> - 2002-04-24 15:08:02
|
Check the error_log of apache and you might get some hints on why apache gives the error. Always check the errorlog. (Guess #1) CGI and mod_perl environments are not exactly the same. I have seen problems if my script is 'forking' and=20 invoking another script (even indirectly). STDIN and STDOUT file descriptors are messed up in mod_perl 1.26. So open("|...") would also fail under mod_perl.=20 (Guess #2) mod_perl doesn't add the standard HTTP headers unless you have SendHeaders option ( I forget the exact name - check mod_perl documentation). What this means is that you script would have to print *all* HTTP headers in addition to printing the Content-Type and so on.. This includes the HTTP status line. Whenever apache detects that some response doesn't have adequate headers, it will prints "internal server error". > -----Original Message----- > From: Lars Skj=E6rlund [mailto:la...@sp...] > Sent: Wednesday, April 24, 2002 3:37 AM > To: per...@li... > Subject: mod_perl problems >=20 >=20 > Hi list, >=20 > I'm writing some code to ask LDAP a few questions and show the result > in a browser. >=20 > My code works fine in standalone mode as well as a common CGI-script, > but when running under mod_perl with Apache, it halts with an=20 > "Internal > Server Error": >=20 > $result =3D $ldap->search(base=3D>"c=3D$ldapCountry", scope=3D>'one', > filter=3D>"o=3D$ldapOrg", attrs=3D>'ACL'); > =20 > my @ACL =3D @{$result->entry(0)->get_value('ACL', asref=3D>1)}; >=20 > The first line executes fine, $result->error reports=20 > 'Success', but the > next line halts the script. >=20 > Anybody's any idea about what goes wrong? >=20 > Regards, > Lars >=20 > Lars Skj=E6rlund, Network Consultant, Spinn International ApS > Bukkeballevej 30, 2960 Rungsted Kyst, Denmark > Tel.: +45 70 25 88 10, Fax: +45 70 25 88 44 > Mail: lars@sReceived: from Skjaerlund-MTA by porter.spinn.dk > pinn.dk Web: http://www.spinn.dk > -- >=20 |