php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44476 Premature end of script headers;
Submitted: 2008-03-19 08:16 UTC Modified: 2008-03-27 01:00 UTC
From: alexc223 at googlemail dot com Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.2.5 OS: OpenSolaris
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-03-19 08:16 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-19 09:39 UTC] scottmac@php.net
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.
 [2008-03-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 13:01:30 2024 UTC