Premature end of script headers: syncscript.pl
am 15.04.2011 10:02:40 von Agnello George
Hi All
In my code i am trying to connect to a db if it fails it should return
0 , this a web based script and it throws me internal server error
and the apache logs gives me Premature end of script headers:
syncscript.pl , But if i am able to connect to the remote host then
my code works fine
print "Content-type: text/html\n\n";
:
:
:
sub some_sub {
eval{
alarm(5);
$DBH_local = DBI->connect("DBI:mysql::192.168.1.26", "all_user",
"all_passwd") ;
alarm(0);
} ;
if ($@){
return 0;
}
}
i even tried the following :
sub some_sub {
$DBH_local = DBI->connect("DBI:mysql::192.168.1.26", "all_user",
"all_passwd") || return 0 ;
} ;
}
but this too doesn't work . gives me the same error "Internal server error "
Please help me with this thanks
--
Regards
Agnello D'souza
--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/
Re: Premature end of script headers: syncscript.pl
am 15.04.2011 10:22:35 von Doug
try add these options when new the DBI object:
PrintError =3D> 0,
RaiseError =3D> 0,
2011/4/15 Agnello George :
> Hi All
>
> In my code i am trying to connect to a db if it fails it should return
> 0 , Â this a web based script and it throws me internal server error
> and the apache logs gives me Premature end of script headers:
> syncscript.pl  , But if i am able to connect to the remote host =C2=
=A0then
> my code works fine
>
>
> print "Content-type: text/html\n\n";
> :
> :
> :
> sub some_sub {
> eval{
> alarm(5);
> Â $DBH_local =3D DBI->connect("DBI:mysql::192.168.1.26", "all_user",
> "all_passwd") Â ;
> Â alarm(0);
> Â } ;
> Â if ($@){
> Â return 0;
> }
>
> }
>
>
>
>
>
> i even tried the following :
>
>
> sub some_sub {
> Â $DBH_local =3D DBI->connect("DBI:mysql::192.168.1.26", "all_user",
> "all_passwd") || return 0 Â ;
>
> Â } ;
>
> }
>
>
> but this too doesn't work . gives me the same error "Internal server erro=
r "
>
> Please help me with this thanks
>
> --
> Regards
> Agnello D'souza
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>
--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/
Re: Premature end of script headers: syncscript.pl
am 15.04.2011 10:34:42 von Agnello George
>>
>>
>> i even tried the following :
>>
>>
>> sub some_sub {
>> =A0$DBH_local =3D DBI->connect("DBI:mysql::192.168.1.26", "all_user",
>> "all_passwd") || return 0 =A0;
>>
>> =A0} ;
>>
>> }
>>
>>
>> but this too doesn't work . gives me the same error "Internal server err=
or "
>>
>> Please help me with this thanks
On Fri, Apr 15, 2011 at 1:52 PM, Doug wrote:
> try add these options when new the DBI object:
>
> PrintError =3D> 0,
> RaiseError =3D> 0,
>
>
i get the error
"Timeout waiting for output from CGI script
/var/www/cgi-bin/syncscript.pl, referer:
http://192.168.1.25/cgi-bin/syncscript.pl"
Actually i am trying to connect to a completely different network
sub some_sub {
$DBH_local =3D DBI->connect("DBI:mysql::192.168.1.26", "all_user",
"all_passwd") || return 0 ; ## this works fine it throws me return 0
$DBH_remote =3D DBI->connect("DBI:mysql:DB1:10.0.0.4", "all_user",
"all_passwd") || return 2 ; ## i get the error "Timeout waiting
for output from CGI script /var/www/cgi-bin/syncscript.pl, referer:
http://192.168.1.25/cgi-bin/syncscript.pl"
}
i have vpn connection on my linux system with my datacenter ip address
as 10.0.0.x . when i shut down my vpn connection it throws me the
above error . could this issue be related to do with network .
--=20
Regards
Agnello D'souza
--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/