|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-19 09:39 UTC] scottmac@php.net
[2008-03-27 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 10:00:01 2025 UTC |
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