perl -pi -e "s/\r\n/\n/g" youfile.pl
[root@server01 cgi-bin]# perl perldiver.cgi
Content-Type: text/html; charset=ISO-8859-1
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"><head><
title>Perl Diver : Main</title>
<style type="text/css">
<!--/* <![CDATA[ */
body {
etc. etc.
-- I bet the problem is one of those.l0rdphi1 said:Hello,
1/ Make sure the Perl script has \n break format:2/ The directory your Perl script resides in must be chowned and chgrped to the user who is running the script (The dir can not be user:apache!!)Code:perl -pi -e "s/\r\n/\n/g" youfile.pl
3/ Make sure the Perl script itself is chmod 755
4/ ExecCGI must be enabled (via httpd.conf or .htaccess) in the directory you've placed the Perl script
That will usually fix most problems
Phi1.
Upload it as ascii.enginaar said:How can i make sure it if it has \n break format.
If you've got shell access and if dos2unix is installed on your server, navigate to the subdirectory where the cgi program is located and then do:Or how can i change it to that format.
Do a google on the error message to see some possible causes and fixes.Is this error message: "Premature end of script headers" related to the \n break format?
l0rdphi1 said:Hello,
1/ Make sure the Perl script has \n break format:2/ The directory your Perl script resides in must be chowned and chgrped to the user who is running the script (The dir can not be user:apache!!)Code:perl -pi -e "s/\r\n/\n/g" youfile.pl
3/ Make sure the Perl script itself is chmod 755
4/ ExecCGI must be enabled (via httpd.conf or .htaccess) in the directory you've placed the Perl script
That will usually fix most problems
Phi1.
RosT said:Siple script don't work:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "All work";