Bug #18305 Updated: PHP Produces Garbage in output with SAPI DLL and Apache2.0.39
| From: | sander@php.net | Date: | Fri, 12 Jul 2002 12:53:56 +0000 |
| Subject: | Bug #18305 Updated: PHP Produces Garbage in output with SAPI DLL and Apache2.0.39 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13980@lists.php.net to get a copy of this message | ||
ID: 18305
Updated by: sander@php.net
Reported By: psychoticwolf@carolina.rr.com
-Status: Open
+Status: Bogus
Bug Type: Apache2 related
Operating System: Windows XP Professional
PHP Version: 4CVS-2002-07-12
New Comment:
PYou need the latest CVS of both PHP and Apache2.
Please reopen this report if it still persists with the latest CVS HEAD
(4.3.0-dev) of PHP and the latest CVS of Apache (2.0.40).
Previous Comments:
------------------------------------------------------------------------
[2002-07-12 07:53:52] psychoticwolf@carolina.rr.com
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 this bug report at http://bugs.php.net/?id=18305&edit=1