8795 sujets

Développement web côté serveur, CMS

bonjour;
mon probleme c'est que quand j'ai execute mon fichier php en local , il m'affiche le message suivant:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1572864 bytes) in C:\wamp\www\franchise-ribambelle.fr\espace_franchise\tcpdf\unicode_data.php on line 4191

merci pour votre aide!!
Ton script PHP nécessite ~15Mo de RAM alors que la configuration de PHP n'autorise que 8Mo par script.

Soit tu changes la config (mais si plus tard tu dois héberger le site en ligne tu devras prendre un serveur dédié), soit tu optimises ton script pour qu'il fonctionne avec moins de RAM (sachant que 15Mo c'est vraiment énorme, en moyenne un script PHP demande moins de 0.2Mo pour fonctionner).
dis moi stp comment je peux faire pour optimiser mon script pour qu'il fonctionne avec moins de RAM!!! merci Smiley smile
Salut,

Sans voir le script dont il est question, je pense qu'il sera impossible que quelqu'un puisse t'aider à l'optimiser. Smiley cligne
en fait mon site est déjà en ligne!!! et au niveau de cette page j'ai des problemes meme en ligne!! défois il m'affiche un message d'erreur et defois il m'affiche la page mais sans les dernieres modifications apportées à cette page!!
voilà , dites moi svp qcq je dois faire pour resoudre ce prob!! merci d'avance Smiley smile
voici le code de ma page!!
<?php require_once('../Connections/connexion.php'); ?>
<?php
session_start();
$MM_authorizedUsers = "";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
  // For security, start by assuming the visitor is NOT authorized. 
  $isValid = False; 

  // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  if (!empty($UserName)) { 
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    $arrUsers = Explode(",", $strUsers); 
    $arrGroups = Explode(",", $strGroups); 
    if (in_array($UserName, $arrUsers)) { 
      $isValid = true; 
    } 
    // Or, you may restrict access to only certain users based on their username. 
    if (in_array($UserGroup, $arrGroups)) { 
      $isValid = true; 
    } 
    if (($strUsers == "") && true) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "../login.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0) 
  $MM_referrer .= "?" . $QUERY_STRING;
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo); 
  exit;
}
?>

<?php

$colname_commandes = "1";
if (isset($_SESSION['MM_Username'])) {
  $colname_commandes = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']);
}
mysql_select_db($database_connexion, $connexion);
$query_commandes = sprintf("SELECT * FROM shop_commande WHERE client = '%s' ORDER BY `id` DESC",$colname_commandes); 

$commandes = mysql_query($query_commandes, $connexion) or die(mysql_error());
$row_commandes = mysql_fetch_assoc($commandes);
$totalRows_commandes = mysql_num_rows($commandes);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="google-site-verification" content="VEeVnsR-Y6RD3-pnopHe4vlxXZ-4ii2jeIY0cmdNIbM" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>franchise enfants avec la ribambelle - Espace administrateur</title>
<meta name="keywords" content="franchise, franchiseur, indépendant, franchising, création, entrepreneur, indépendant, patron, entreprise">
<meta name="description" content="devenez un franchisé ribambelle et créez votre agence d'animation, le spécialiste de l'animation enfantine depuis 25 ans.">
<meta http-equiv="Content-Language" content="fr">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="shortcut icon" href="../sw/favicon.ico"  type="image/x-icon"/>

<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="../sw/AC_RunActiveContent.js" language="javascript"></script>

<style type="text/css"> 
<!--
body {
	background-color: #CCCC66;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.Style1 {
	font-family: "trebuchet MS";
	font-size: 12px;
	color: #000000;
}
a:link {
	color: #0066CC;
}
.Style6 {
	font-size: 15px;
	font-weight: bold;
}
.Style10 {
	font-family: "trebuchet MS";
	font-size: 13px;
	color: #000000;
}
.Style14 {
	font-family: "Elephant";
	font-size: 20px;
	color: black;
}
.Style15 {
	text-align:left;
	font-family: "Elephant";
	font-size: 30px;
	color: black;
}
.Style16 {
	font-family: "trebuchet MS";
	font-size: 20px;
	color: black;
}
-->
</style>

<script src="../sw/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="226" valign="top"><script type="text/javascript"> 
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','200','height','662','align','left','src','../sw/ridog2','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgcolor','#CCCC66','movie','../sw/ridog2' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="200" height="662" align="left">
      <param name="movie" value="../sw/ridog2.swf" />
      <param name="quality" value="high" />
      <param name="BGCOLOR" value="#CCCC66" />
      <embed src="../sw/ridog2.swf" width="200" height="662" align="left" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#CCCC66"></embed> </object></noscript></td>
    <td width="792" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td bgcolor="#CCCC66"><center>
          
  <!--URL utilisées dans l'animation-->
  <!--texte utilisé dans l'animation-->
  <!-- saved from url=(0013)about:internet -->
        <script language="javascript"> 
	if (AC_FL_RunContent == 0) {
		alert("Cette page nécessite le fichier AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','name','sw/newbando1','width','650','height','185','align','middle','id','sw/newbando1','src','sw/newbando1','quality','high','wmode','transparent','bgcolor','#CCCC66','allowscriptaccess','sameDomain','allowfullscreen','false','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','sw/newbando1' ); //end AC code
	}
        </script>
        <noscript>
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" name="sw/newbando1" width="650" height="185" align="middle" id="sw/newbando1">
          <param name="allowScriptAccess" value="sameDomain" />
          <param name="allowFullScreen" value="false" />
          <param name="movie" value="sw/newbando1.swf" />
          <param name="quality" value="high" />
          <param name="wmode" value="transparent" />
          <param name="bgcolor" value="#CCCC66" />
          <embed src="sw/newbando1.swf" quality="high" wmode="transparent" bgcolor="#CCCC66" width="650" height="185" name="sw/newbando1" align="middle" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />        
</object>
        </noscript>
        </center>         </td>
      </tr> 

      <tr>
 	 <td bgcolor="#CCCC66"><div align="center"><span class="Style1 Style6"><span class="Style14">Espace franchisés</span></span><br />		      </div>
     <br/>
	 <div align="left"><span class="Style15">Détail des commandes & factures</span></div>
     <br/>
     	  <p class="Style16">Vos derni&egrave;res commandes  <?php echo $_SESSION['MM_Username']; ?> :</p>
	  <table width="99%" cellpadding="5"  cellspacing="1" bgcolor="#666666">
        <tr bgcolor="#FFFFFF">
          <th scope="col"><span class="Style1 Style1">Num&eacute;ro de commande </span></th>
          <th scope="col"><span class="Style1 Style1">Poids </span></th>
          <th scope="col"><span class="Style1 Style1">Total TTC </span></th>
          <th scope="col"><span class="Style1">Date de Commande </span></th>
          <th scope="col"><span class="Style1 Style1">Date d'exp&eacute;dition</span></th>
          <th scope="col"><span class="Style1 Style1">Bon de commande format PDF</span></th>
          <th scope="col"><span class="Style1 Style1">Bon de livraison format PDF</span></th>
          <th scope="col"><span class="Style1 Style1">Facture format PDF</span></th>
        </tr>
        
        <?php do { ?>
        
        		<?php
    		$date =$row_commandes['date'];
			$total_ht =$row_commandes['total_ht'];
			$c_total_ttc =$row_commandes['total_ttc'];
			$expedition =$row_commandes['expedition'];

			$date_french= preg_replace("/([0-9].*)-([0-9].*)-([0-9].*)/" ,"\\3-\\2-\\1",$date);
			$date_expedition= preg_replace("/([0-9].*)-([0-9].*)-([0-9].*)/" ,"\\3-\\2-\\1",$expedition);
			$total_ttc_arrondi= number_format($c_total_ttc, 2, ',', ' '); 
        		?>
        <tr bgcolor="#FFFFFF">
          <td><a href="detail_commande.php?id=<?php echo $row_commandes['id']; ?>" class="Style1 Style1"><?php echo $row_commandes['id']; ?></a></td>
          <td><div align="right"><span class="Style1 Style1"><?php echo $row_commandes['poids']; ?>gr.</span></div></td>
          <td><div align="right"><span class="Style1 Style1"><?php echo $total_ttc_arrondi; ?></span></div></td>
          <td><div align="center"><span class="Style1"><?php echo $date_french; ?></span></div></td>
          <td><div align="center"><span class="Style1"><?php echo $date_expedition; ?></span></div></td>
           <td><div align="center"><span class="Style1"><a href="bon_commande.php?id=<?php echo $row_commandes['id']; ?>">Bon de commande</a></span></div></td>
          <td><div align="center"><span class="Style1"><a href="bon_livraison.php?id=<?php echo $row_commandes['id']; ?>">Bon de livraison</a></span></div></td>
          <td><div align="center"><span class="Style1"><a href="traitement_facture.php?id=<?php echo $row_commandes['id']; ?>">Facture</a></span></div></td>
        </tr>
        <?php } while ($row_commandes = mysql_fetch_assoc($commandes)); ?>
        
      </table> <br/>
      
       <p align="center"><a href="admin/espace_admin.php">Retour</a></p>
       
	  <p>&nbsp; </p>
      </tr>
      <tr>
        <td height="45" bgcolor="#CCCC66"><div align="center" class="Style10">
          <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','630','height','35','src','../sw/footer','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../sw/footer' ); //end AC code
          </script>
          <noscript>
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="630" height="35">
            <param name="movie" value="../sw/footer.swf" />
            <param name="quality" value="high" />
            <embed src="../sw/footer.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="630" height="35"></embed>
          </object>
          </noscript>
          </div></td>
      </tr>
      <tr>
        <td bgcolor="#CCCC66"><p>&nbsp;</p>
          <p align="left">&nbsp;</p>
          <p>&nbsp;</p>
          <p>&nbsp;</p>
          <p>&nbsp;</p></td>
      </tr>
    </table></td>
    <td width="200" valign="top"><script type="text/javascript"> 
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','200','height','662','src','../sw/rido_d2','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../sw/rido_d2' ); //end AC code
    </script>
      <noscript>
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="200" height="662">
        <param name="movie" value="../sw/rido_d2.swf" />
        <param name="quality" value="high" />
        <param name="BGCOLOR" value="#CCCC66" />
        <embed src="../sw/rido_d2.swf" width="200" height="662" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#CCCC66"></embed>
      </object>
    </noscript></td>
  </tr>
</table>
</body>
</html>

<?php
mysql_free_result($commandes);
?>
Combien de résultats retourne cette requête ?
$row_commandes = mysql_fetch_assoc($commandes)

Modifié par moust (23 May 2011 - 10:33)
bjr, enfait elle m'affiche dans un tableau , le id,poids, total, date d ela commande, date d'expedition, la facture en pdf, le bon de commande en pdf. ce code je les mis pour deus pages de mon site une là ou jai besoin qu"elle m'affiche que 2 entregistrement dans ca tableau, cellà fonctionne parfaitement et l'autre ou jai besoin qu"elle m'affiche une dizaine d'enregistrements elle beug, quand je clique par exmple sur facture en pdf , elle m'affiche pas la facture mais elle sort complétement du site!!! et ça en ligne mais en local elle m'affiche erreur 404 , not found!!!! et je ne sais pas c'est koi le probleme !! Smiley rolleyes Smiley sweatdrop