Bug #18305: PHP Produces Garbage in output with SAPI DLL and Apache2.0.39
| From: | psychoticwolf at carolina dot rr dot com | Date: | Fri, 12 Jul 2002 11:53:54 +0000 |
| Subject: | Bug #18305: PHP Produces Garbage in output with SAPI DLL and Apache2.0.39 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-13962@lists.php.net to get a copy of this message | ||
From: psychoticwolf@carolina.rr.com
Operating system: Windows XP Professional
PHP version: 4CVS-2002-07-12
PHP Bug Type: Apache2 related
Bug description: PHP Produces Garbage in output with SAPI DLL and Apache2.0.39
PHP Produces Garbage in output with SAPI DLL (php4apache2.dll) and
Apache2.0.39
The output data from the MySQL Query (included below), is either truncated
or mixed in with "garbage" characters..
ÐøhNTZThÈZôïÈZôï¤ (etc..)
Which results in a jumbled display of the query.
Information that seems to be relevant.. is that the bug does not appear
when accessing the script from localhost.. only from another machine.. The
MySQL query as it's written below
would pull all 19 records of a 23.8kb MySQL table..
<!-- MySQL PHP Query-->
<?php
$sql = "SELECT * FROM
jakesnote ORDER BY id DESC LIMIT 0, 50";
$sql_result = mysql_query($sql, $connection) or die ("Could not get
Query");
while ($row = mysql_fetch_array($sql_result)) {
$id = $row["id"];
$date = $row["date"];
$info = $row["info"];
$whatsnew = $row["whatsnew"];
$day=substr($date,6,2); //get the day
$month=substr($date,4,2); //get the month
$year=substr($date,0,4); //get the year
$hour=substr($date,8,2); //get the hour
$minute=substr($date,10,2); //get the minute
$sec=substr($date,12,2); //get the sec
// $mydate ="$month/$day/$year - $hour:$minute:$sec"; //var to be
returned
$mydate ="$month/$day/$year"; //var to be returned
echo"<TR><TD ALIGN=CENTER height=\"20\"
class=\"Header1\"><b><font
size=\"4\">Updated: $mydate</font></b></TD></TR>";
echo"<TR><TD ALIGN=LEFT><FONT
SIZE=\"4\">$info</FONT></TD></TR>";
echo"<TR><TD ALIGN=LEFT><FONT
SIZE=\"4\"><B><I>What's
New?</I></B></FONT><BR>$whatsnew</TD></TR>";
}
?>
-- Config.php (Required Included file for MySQL Setup --
<?php
//-- Website Setup --//
$siteDrive="d:";
#siteDrive="e:";
$sitePath="websites//crushme";
#sitePath="ServerFiles//Websites//crushme";
$siteInstall="$siteDrive//$sitePath";
$siteInclude="mydata";
$siteDataPath="$siteInstall//$siteInclude";
#siteDomain="http://crushme.clients.philipnz.com";
$siteDomain="http://crushme.dyndns.org";
//-- My Sql Mgt --//
$mysqlServer="localhost";
$mysqlLogin="root";
$mysqlPass="";
$mysqlData="jakesplace";
$connection = mysql_connect("$mysqlServ","$mysqlLogin","$mysqlPass")
or
die ("Could not connect to Server");
$db = mysql_select_db("$mysqlData", $connection) or die ("Could not select
database!");
//-- Header and Footer --//
$page_head="$siteDataPath/page_head.php";
$page_foot="$siteDataPath/page_foot.php";
?>
I've also observed this bug without MySQL.. when having PHP include a 27kb
static html document.
<?php
require"../config.php";
include"$page_head";
include"home.htm";
include"$page_foot";
?>
Both the above scripts/files worked correctly on Apache 2.0.36 with
php4apache2.dll loaded as a DSO.. PHP version (4.2.1)..
The errors began after upgrading to Apache 2.0.39 (with PHP 4.2.2-dev
(July 3rd edition)... and still exist in the current 4.2.2-dev CVS
version..-- (Build Date Jul 12 2002 10:13:33.) The error is more
randomized in the current -stable CVS build.. than the 7/3 one.. which had
it occuring constantly.
The errors do not occur when using Apache 1.3.26 with the same PHP
Edition.. (only difference, obviously, is the SAPI DLL for Apache and
Apache2..)
An attempt to check the current branch of 4.3.0-dev in CVS for Win32
failed because Apache2 crashed. So I don't know if it's fixed in that
build or not.
I have been able to recreate the error on another machine using the same
versions of the software. Don't know if this'll be of any use.. but the
MySQL version is 3.23.51.
Thanks in advance
-- Chris
--
Edit bug report at http://bugs.php.net/?id=18305&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18305&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18305&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18305&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18305&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18305&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18305&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18305&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18305&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18305&r=globals