ID: 13977
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Old Status: Feedback
Status: Open
Bug Type: Reproducible crash
Operating System: Windows 2000 SP2
PHP Version: 4.0.6
New Comment:

Hi all,

the problem is, that the script not allways crashes. It just crashes on my home pc 
with amd-cpu. I also put the script online (Linuxbox, Kernel 2.2.16, mod_php-4 
(4.0.6), Apache/1.3.19 (Unix)  (SuSE/Linux), MySQL 3.23.43  ,and there it runs 
perfectly:

Here is the script:

=====================================================
<?php
//// Version 0.1
//// hcms_fe_engine.php
//// ( Frontendengine )
//// Gibt den Inhalt der Site für WebUser aus
/////////////////////////////////////////////////////////////
// Sessionverwaltung einbinden
include ('hcms_fe_session.php');

// Allgemeine Konfiguration einbinden
include('hcms.init.php');

// Datenbankschnittstelle einbinden
include ('hcms_smod_db.php');

// FE-Funktionen einbinden
include('hcms_fe_functions.php');

// Site-Konfiguration aus DB holen
$sConfig = getSiteConfig();

// Überprüfen, ob Site online ist
if ($sConfig[online] == "n") {

   header("Location: hcms_fe_siteoffline.html");  // Ausweichdokument anzeigen

} 
// Site ist online
else { 
  
   // Prüfung ob GenTime gewünscht
   if ($sConfig[showgentime] === "y") {
      // Start der Erstellungsdauer
      $timer = new cGenTime;
      $timer->start();
   }
   /// ENDE Prüfung GenTime gewünscht
   
   
   
   ////////
   //
   // Seiten-Code erzeugen
   //
   ////////
   
   if (!isset($location)) {

      $location = 1;
   
   }
   
   /// Seitenkopf generieren
   echo("<html><head><title>$sConfig[sitename]</title></head><body 
bgcolor=\"#999966\">");
   include('layouts/site.css');
   
   // Main-Layout-Tabelle generieren
   echo ("<center>
          <table class=bodytab cellpadding=0 cellspacing=0 border=0 width=800>");
   echo ("<tr><td colspan=3 height=81><img src=\"".$IMG_SITE."logo_head.png\" border=0 
width=800></td></tr>");
   echo("<tr><td colspan=3 height=10 valign=top width=800>");

   // Main-Menu aus DB holen
   $mmenu = generate_menu(1,$location);

   echo("<table cellspacing=0 cellpadding=0 border=0 width=\"800\">
         <tr><td class=conmenu>&nbsp;&nbsp;");^


   for ($i = 1; $i <= count($mmenu) - 1; $i++) {

       echo("$mmenu[$i]&nbsp;&nbsp;|&nbsp;");
   }

^^^^^^^^^^^^^^^^^^^^^^^^
This is the part that crashes under Win2k....
The 3. iteration of the loop. Not everytime, but often....

   echo("<a href=hcms_admin_login_form.php>Login</a>");
   echo ("</td><td class=conmenu align=right>");echo(datum());echo("</tr></table>");
   
   echo("</td></tr>");

   // Kontextzeile einblenden
   echo("<tr><td class=fecx align=>
      &nbsp;&nbsp;<a href=\"$PHP_SELF\"><img src=\"pics_intern/news_haus.png\" 
border=0></a>
          &nbsp;
          <a href=\"mailto:$sConfig[webmaster]\";><img 
src=\"pics_intern/news_umschlag.png\" border=0></a>
      </td><td class=fecx><font color=white>Sie befinden sich <font color=orange><b> 
>>> </b></font> ");
      echo(getCX($location, $cx));
   echo("</font></td><td class=fecx>&nbsp;</td></tr>");
   
   
   echo("<tr><td class=tdsmenu valign=\"top\">");
   // Sub-Menu aus DB holen
   get_subcats($location);
   
   ///////////////////////////////////////////
   // Content aus DB holen
   ///////////////////////////////////////////
   echo("&nbsp;</td><td class=tdcontent valign=top>");
   //////////////

   if (isset($cx) && isset($idart)) {
     $file = renderCat($cx, $idart);
     include("$DYN_PATH$file");
         // Temporäre Inc-Datei nach Verwendung löschen
         unlink("$DYN_PATH$file");
   }
   elseif (isset($cx)) {
     $file = renderCat($cx, "");
     include("$DYN_PATH$file");
         // Temporäre Inc-Datei nach Verwendung löschen
         unlink("$DYN_PATH$file");
   } else {
     $file = renderCat($location, "");
     include("$DYN_PATH$file");
         // Temporäre Inc-Datei nach Verwendung löschen
         unlink("$DYN_PATH$file");
   }

   
   ////////////////////////////////////////       
   echo("</td>");
   // ENDE Content aus DB holen
   ////////////////////////////////////////
   
   /////////////////////////////////////////////
   // Polls und Akutinfos aus DB holen
   echo("<td class=tdpoll>");
   
     echo("Poll");
   
   echo("</td>");
   //// Ende Polls und Akutinfos aus DB holen
   /////////////////
   echo("</tr></table></center><br>");
   
   /////////////////////////////////////////////
   /////// Nochmalige Prüfung ob Timer gewünscht
   if ($sConfig[showgentime] == "y") {
      // Zeit stoppen
      $timer->stop();
      echo("<hr width=800><center>Diese Seite wurde generiert in ");
      $timer->showtime();
      echo(" Sekunden</center>");
   }
   //////////////////////////////////////////////
   
   // Prüfen, ob Poweredby-Logo gewünscht
   if ($sConfig[showpoweredby] == "y") {
   
      echo("<br><center><a href=\"http://www.heavensoft.org\"; target=_blank>
               <img src=\"pics_intern/hcms_logo.png\" border=0></a>");
   
   }
 
   
/// Seitenfuss generieren
echo("</body></html>");
} // ENDE else Site ist online
?>

==========================================================

thx a lot,

Meikel Bode

Previous Comments:
------------------------------------------------------------------------

[2001-11-08 11:51:10] [EMAIL PROTECTED]

Please include the shortest possible script (preferrably link to it) that crashes PHP.

------------------------------------------------------------------------

[2001-11-07 08:07:05] [EMAIL PROTECTED]

I exatly mean the 3. interation of the for-loop!!!

------------------------------------------------------------------------

[2001-11-07 08:03:51] [EMAIL PROTECTED]

Using Win2k/SP2, MySQL 3.23.44 Windows 95/98/NT/2000/XP on an AMD-Athlon-System. 
The problem is, that sometimes PHP crashes when getting data from the db.

I'm using the following code-snip to generate an click-menu:

============================================================
// Get Main-Menu from database
$mmenu = generate_menu(1,$location);

echo("<table cellspacing=0 cellpadding=0 border=0 width=\"800\">
<tr><td class=conmenu>&nbsp;&nbsp;");

//// THIS IS THE PLACE WHERE PHP CRASHES.
//// Not everytime, but often

for ($i = 1; $i <= count($mmenu) - 1; $i++) {

  echo("$mmenu[$i]&nbsp;&nbsp;|&nbsp;");

}
[...]
============================================================

I'm using more than one computer to work with the code and two diferent OS'ses (Win2k 
/ SuSE-Linux 7.3). I just encountered problems with Win2k on the mashine with AMD-CPU.

thx,

Meikel Bode

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=13977&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to