#44476 [Opn->Fbk]: Premature end of script headers;
| From: | scottmac@php.net | Date: | Wed, 19 Mar 2008 09:39:29 +0000 |
| Subject: | #44476 [Opn->Fbk]: Premature end of script headers; | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-123460@lists.php.net to get a copy of this message | ||
ID: 44476
Updated by: scottmac@php.net
Reported By: alexc223 at googlemail dot com
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: OpenSolaris
PHP Version: 5.2.5
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2008-03-19 08:16:19] alexc223 at googlemail dot com
Description:
------------
When using PDO prepare (and query as well) running with fcgi it causes
an Internal Server Error and Premature end of script headers;
(excuse the messy code, just for a test case)
Reproduce code:
---------------
<?php
class Config_sql {
public function __construct() {
$this->_sql = new PDO(
'mysql:host=127.0.0.1;dbname=foobar;port=3306', 'username', 'password'
);
}
public function load( $table ) {
$pdo_st = $this->_sql->prepare( 'SELECT * FROM tcm_'.$table.'_envs
WHERE id = ?' );
$pdo_st->execute( array( 1 ) );
die( var_dump( $pdo_st->fetchAll( PDO::FETCH_ASSOC ) ) );
}
}
$conf = new Config_sql;
$conf->load( 'config' );
?>
Expected result:
----------------
An output such as the following:
array
0 =>
array
'id' => string '1' (length=1)
'env' => string 'production' (length=10)
'extends' => string '0' (length=1)
Actual result:
--------------
Internal Server Error and this in my error.log
[Wed Mar 19 08:10:58 2008] [warn] mod_fcgid: Read data error, fastcgi
server has close connection
[Wed Mar 19 08:10:58 2008] [error] [client xxx.xxx.xxx.xxx] Premature
end of script headers: pdo_bug.php
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44476&edit=1