Bug #14222 Updated: PHP Crashes with weird output often
| From: | mail at seen dot ch | Date: | Mon, 26 Nov 2001 12:14:15 +0000 |
| Subject: | Bug #14222 Updated: PHP Crashes with weird output often | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-71645@lists.php.net to get a copy of this message | ||
ID: 14222
User updated by: mail@seen.ch
Reported By: mail@seen.ch
Old Status: Feedback
Status: Open
Bug Type: Apache related
Operating System: Windows XP Pro
PHP Version: 4.0.6
New Comment:
Its not reproduce able (thats why called weird)
specially the output is always diffrent and irregular...
i'll test it in the office (also with XP)
Previous Comments:
------------------------------------------------------------------------
[2001-11-26 07:09:14] sniper@php.net
Please include a SHORT example script that can be used to
reproduce this. And also try PHP 4.1.0 (will be released today/tomorrow)
--Jani
------------------------------------------------------------------------
[2001-11-26 02:48:37] mail@seen.ch
Ah here is an output examle (describet ping ~20).
http://tugs.imp.ch/index.html.2
my localhostoutput:
http://tugs.imp.ch/index.html.3
i cant pate the output of the 3rd test (ping ~60) because its impossible to get the page.
btw browser issius with this:
ie starts to relaod and relaod the page again and again, sometimes often, sometimes not. he relaods
until he gets a useable document or used so many http connections that he cant find the document :)
opera just dont stop loading the page or crashes totally :)
------------------------------------------------------------------------
[2001-11-26 02:37:45] mail@seen.ch
Its like the Bug id #13371, just i found the same thing with Apache 1.3.22.
Installed:
Apache 1.3.22
PHP 4.0.6 (both, full and installer make problems)
MySQL 4.0.0a
on a Win XP En Machine.
PHP used with php4apache.dll
Very weird things:
Some code dont work, some work fine.
Ex.: phpMyAdmin dont have any problems
Code Example:
//////////////////////////////////////
//Start of Code Example
//////////////////////////////////////
<html>
<head>
<?php
//Funktion für DB Errors
function print_db_error($query) {
$errno=addslashes(mysql_errno());
$error=addslashes(mysql_error());
echo $query."<br>liefert folgende Fehlermeldung:<br>".$errno.$error;
}
//Login
function login($uin){
if($uin == "xxx") return 1;
};
//simple abfrage (1 user)
if($HTTP_POST_VARS[submit]==go){
if($username==xxx AND $password==xxx)
$uin = "xxx";
};
//$loggedin = login($uin);
$loggedin = 1;
//Funktion für MySQL querys
function sql($query){
$hostname = "dedi.gamelife.ch";
$db_username = "xxx";
$password = "xxx";
$dbName1 = 'xxx';
$conn = mysql_pconnect($hostname, $db_username, $password);
if(!$conn){
echo "<B>Oops, der Datenbankserver hat wohl die Hosen runtergelassen!";
exit;
};
$select = mysql_select_db($dbName1,$conn);
$abfrage=mysql_query($query, $conn)
or
print_db_error($query);
return $abfrage;
};
//Tables
$tbl_list = priv_divxlist;
//Update the instore
if($action=="changestore"){
(mysql_result(sql("SELECT instore FROM $tbl_list WHERE id='$id'"),0)) ?
$newstore = "0" : $newstore = "1";
sql("UPDATE $tbl_list SET instore='$newstore' WHERE id='$id'");
};
//Default: sortby name
if(!isset($sortby))
$sortby = "titel asc";
?>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#829DD2"
vlink="#829DD2">
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<? if(!$loggedin){?>
<form action="<?=$PHP_SELF?>?sortby=<?=$sortby?>" method=post>
Login: <input type="text" name="username" size="5"> <input
type="password" name="password" size="5"> <input
type="submit" name="submit" value="go"></form>
<? }else{ ?>
<a href="newp.htm">Create new Item</a><br>
<? }; ?>
<br>
<table border=0 cellpadding="0" cellspacing="0">
<tr>
<td><font size=2><a href="<?=$PHP_SELF?>?sortby=<? echo
($sortby=="titel desc") ? "titel asc" : "titel desc";
?>&uin=<?=$uin?>">Titel</a></font><br><br></td>
<td><font size=2><a href="<?=$PHP_SELF?>?sortby=<? echo
($sortby=="lang desc") ? "lang asc" : "lang desc";
?>&uin=<?=$uin?>">Sprache</a> </font><br><br></td>
<td><font size=2><a href="<?=$PHP_SELF?>?sortby=<? echo
($sortby=="anz desc") ? "anz asc" : "anz desc";
?>&uin=<?=$uin?>">Anz</a> </font><br><br></td>
<? if($loggedin){ ?>
<td><font size=2>Delete </font><br><br></td>
<td><font size=2>Edit</font><br><br></td>
<td><font size=2>In Store</font><br><br></td>
<? }; ?>
</tr>
<?
$abfrage = sql("select id,titel,anz,lang,instore from $tbl_list ORDER by $sortby,titel");
while (list($id,$theaser,$anz,$lang,$instore) = mysql_fetch_row($abfrage)){
$theaserprint = $theaser;
//if (strlen($theaser) > 30) $theaserprint = substr($theaserprint,0,25)."..."; ?>
<tr>
<td width="300"><font
size=2><?=$theaserprint?></font></td>
<td width="50" align="center"><font
size=2><?=$lang?></font></td>
<td width="30" align="center"><font
size=2><?=$anz?></font></td>
<? if($loggedin){?>
//////////////////////////////////////
//Note part here to
<td width="30" align="center"><font size=2><a
href="del.php?id=<?=$id?>&uin=<?=$uin?>" style="text-decoration:
none;">[del]</a></font></td>
<td width="39" align="center"><font size=2><a
href="editp.php?id=<?=$id?>&uin=<?=$uin?>" style="text-decoration:
none;">[edit]</a></font></td>
//here
//////////////////////////////////////
<td width="39" align="center"><font size=2><a
href="<?=$PHP_SELF?>?uin=<?=$uin?>&sortby=<?=$sortby?>&action=changestore&id=<?=$id?>"
style="text-decoration: none;"><? echo ($instore) ? "yes" :
"no";?></a></font></td>
<? };?>
</tr>
<?};?>
</table>
Total Films: <?=mysql_result(mysql_query("SELECT count(*) FROM $tbl_list"),0);?>
</font>
</body>
</html>
//////////////////////////////////////
// End of code example
//////////////////////////////////////
Take a look at the special marked part in the code. If this part isnt included, the i still have
errors, but only about 20% than with the code (lol).
The code should be 100% correct also, and on *nix servers it runs very well.
Theremore the output is always different. It outputs what it wants :) with part like
"dddfffff" and 200x a "F", this also in a loop where thats nearly impossible :)
Also i tested it with some friends. At the time it runned well on my localhost (with a smaller
code), i wget the document from an other server (ping ~20) and had some more errors in it, but
constant more (tried it more than once).
An other person tried it also (ping ~60) and never reached the dokument how it should be.
Hope i can help out with this :p
Greets
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14222&edit=1