ID:               44476
 Updated by:       [EMAIL PROTECTED]
 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

Reply via email to