From:             alexc223 at googlemail dot com
Operating system: OpenSolaris
PHP version:      5.2.5
PHP Bug Type:     PDO related
Bug description:  Premature end of script headers;

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 bug report at http://bugs.php.net/?id=44476&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44476&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44476&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44476&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44476&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44476&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44476&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44476&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44476&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44476&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44476&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44476&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44476&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44476&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44476&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44476&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44476&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44476&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44476&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44476&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44476&r=mysqlcfg

Reply via email to