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

Premature end of script Headers

Status
Not open for further replies.

justcgi

Technical User
Oct 10, 2005
4
US
I have website with index.cgi file running in redhat 9 server,I encounter error 500 when trying to move this website to other server Redhat linux E.3

error log is pasted below,


[Wed Oct 05 23:14:20 2005] [error] [client 65.002.89.194] Can't locate
CGI.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at
/home/she/public_html/index.cgi line 2.
[Wed Oct 05 23:14:20 2005] [error] [client 65.242.89.194] BEGIN
failed--compilation aborted at /home/she/public_html/index.cgi line 2.
[Wed Oct 05 23:14:20 2005] [error] [client 65.002.89.194] Premature end of
script headers: index.cgi



(Please Help)
thanks,
justcgi.
 
the problem is:

Can't locate CGI.pm in @INC

which is probably line 2 in your index.cgi scipt:

use CGI;

can you verify that the CGI.pm is installed?
 
Thank you for replying,

I don’t have CGI.pm file in the new server!!!
So you think if I copy the file from the old server it will work?

The first lines of index.cgi script is pasted below (please check).


#!/usr/bin/perl
use CGI qw/:standard/;
use CGI::Cookie;

# Create cookie
$cookie1 = new CGI::Cookie(-name=>'login',-value=>'yes');



Thanks,
justcgi
 
you have perl 5.8.0, I thought CGI.pm was part of the standard install from around 5.6 IIRC

BTW, there appears to be a space at the end of 5.8.0_, not sure if this should be a cause for concern, but it just don't look right to me ;-)

HTH

Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
your host removed the CGI.pm module? Find a new host, that is a crippled perl install, who knows what else they have removed.

You could put CGI.pm in the cgi-bin and it should work, but it sounds like the host doesn't want you using that module if they removed it from the imstall of perl. Ask them before trying.
 
thanks for the hints,

I’ve copied the old file of CGI.pm but it says there are error in line 27, error is:

[Tue Oct 11 22:30:22 2005] [error] [client 63.210.59.78] BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.0/CGI.pm line 27.
[Tue Oct 11 22:30:22 2005] [error] [client 63.210.59.78] Compilation failed in require at /home/she/public_html/index.cgi line 2.
[Tue Oct 11 22:30:22 2005] [error] [client 63.210.59.78] BEGIN failed--compilation aborted at /home/she/public_html/index.cgi line 2.
[Tue Oct 11 22:30:22 2005] [error] [client 63.210.59.78] Premature end of script headers: index.cgi


The 27th line in CGI.pm is:

use CGI::Util qw(rearrange make_attributes unescape escape expires


what else I should do?
 
Is your webroot configured to run cgi scripts, that's not good, should be in a subdir of /cgi-bin. I know it can work, but given the rest of your issues.

Ask your host to reinstall CGI.pm

--Paul

Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
CGI is a family of modules, so you would also have to copy over all the modules that CGI.pm uses internally. I forgot about when I made my original suggestion. You can get all the core CGI modules from cpan, they start with "CGI::"


you really need a new host though hopefully you can move your site. This could be the tip of the iceberg as far as problems trying to run CGI/perl scripts goes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top