php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14073 Premature end of script headers
Submitted: 2001-11-15 16:05 UTC Modified: 2001-11-18 18:30 UTC
From: actualmatt at yahoo dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.0.6 OS: Win98
Private report: No CVE-ID: None
 [2001-11-15 16:05 UTC] actualmatt at yahoo dot com
Running PHP 4.0.6 on Apache 1.3.20, on Win98SE... Browser returns the "500 - Internal Server Error" msg, and the error log reports "Premature end of script headers: c:/php/php.exe"

It seems to be caused by an if() inside a while(), which is inside a foreach(). The script will reach that point with no problems, but crashes on the execution of the "if( $day > $startdate and $day < $enddate ){}"

PHP is only compiled with the default modules.

The other thing worth noting is that I get a "Php: This program has performed an illegal operation and will be shut down" dialog box.

Thanks,
Matt Wilson <actualmatt@yahoo.com>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-15 16:07 UTC] actualmatt at yahoo dot com
...also, it does the same thing when run from the command line
 [2001-11-15 16:25 UTC] actualmatt at yahoo dot com
actually, after further checking it out, it is causing an invalid page fault in PHP4TS.DLL... does this mean it is a problem with my system, rather than PHP?
 [2001-11-15 19:25 UTC] sniper@php.net
Add shortest possible script which can be used to reproduce
this problem into this report.

--Jani


 [2001-11-15 20:23 UTC] actualmatt at yahoo dot com
This is the script that causes the problems:
(I tried cutting it down more, but as the problem part relies on the rest of the script it wasn't possible)

<?php
if( !isset( $month )) {
$month = date("m");
}
$month = str_pad( $month, 2, "0", STR_PAD_LEFT);
$month = str_pad( $month, 4, "0");

$people = array( "ross", "jen", "jon", "mp", "matt", "marty" );

$link = odbc_connect( 'calendar', '', '' )
	or die("connect failed");

foreach( $people as $person ) {

  $result = odbc_exec( $link, "SELECT * FROM calendar WHERE name = '$person'");
  echo $person ."<br>";

  while( odbc_fetch_row( $result ) ){
    $startdate = odbc_result( $result, 2 );
    $enddate = odbc_result( $result, 3 );

    $startdate = substr( $startdate, 4, 4 );
    $enddate = substr( $enddate, 4, 4 );

     for( $day = 1; $day <32; $day++ ){
				
	if( $day > $startdate and $day < $enddate ) {
     //BUG OCCURS HERE	
            $$person[ $month ][ $day ] = "away";
				} else {
	    $$person[ $month ][ $day ] = "here";
				}
	echo $$person[ $month ][ $day ] ."<br>";
		}
}}
?>
 [2001-11-18 18:30 UTC] sniper@php.net
It's hard to tell whether the problem is in ODBC part
or something else. This is not a bug in PHP but in your
script / system settings. Check your error logs for more
information. Try also running the script from command line.

Ask further support questions on the mailing lists:

http://www.php.net/support.php

--Jani


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 08:01:35 2024 UTC