IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

Fatal error: Out of memory (allocated 30408704) (tried to al


Sujet :

PHP & Base de données

  1. #1
    Membre habitué
    Inscrit en
    Janvier 2008
    Messages
    1 159
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 1 159
    Points : 149
    Points
    149
    Par défaut Fatal error: Out of memory (allocated 30408704) (tried to al
    Bonjour,

    suite a un script upload qui fonctionner tres bien ce matin, j'ai ce message qui s'affiche:

    Fatal error: Out of memory (allocated 30408704) (tried to allocate 12288 bytes) in /homepages/25/d360145515/htdocs/mybabylove/lib/thumbs.class.php on line 364</code>

    je fais des recherche et on me dit que ca peut etre la taille mais je ne comprend pas ce matin cela fonctionner meme avec ces images.

    voici ma fonction:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    <?php
    public function upload($_FILES,$idAnnonce,$idInscrit)
    	{
     
    /*------------------------------------------------------------------------------*/
    		/*Creation des dossiers d'illsutration si ils n'existent pas de chaque produit*/
    		/*-----------------------------------------------------------------------------*/	
     
    		$dirSmall='illustration/small';
     
     
    			if (is_dir($dirSmall)) 
    			{
     
    				/***************************on verifie si le dossier small du produit existe****************/
    				if(!is_dir($dirSmall.'/'.$idAnnonce))
    				{
     
    					$dossierSmall=mkdir($dirSmall.'/'.$idAnnonce);
     
     
    				}
     
    				/*------------------------------------------------------------------------------*/
    				/*Creation des miniatures en 1 formats differents (300*300)*********/
    				/*-----------------------------------------------------------------------------*/						
     
    				$NomImageFinalSmall= $idInscrit.'-'.$idAnnonce.'-'.'small';
     
     
    				if(isset($_FILES['fichier']['name']))
    				{
     
    					$source_image_extension = thumbs::get_image_extension($_FILES['fichier']['name']);
    					$source_image_path = 'illustration/background.'.$source_image_extension;
     
    					if(move_uploaded_file($_FILES['fichier']['tmp_name'], $source_image_path))
    					{
     
    						$thumbs_saving_path_Small = 'illustration/small/'.$idAnnonce.'/';
     
    						$thumbs_image_quality = 100;
     
    						$tbSmall= new thumbs($source_image_path, $thumbs_saving_path_Small, $thumbs_image_quality);
    						$tbSmall->resize(300,300,"FFFFFF",$NomImageFinalSmall.'.jpeg');
     
     
    						unlink($source_image_path);
    					}
    				}
    				else
    				{
    					echo 'Le sous-dossier de l illustration n existe pas.';
    				}
     
    				}
    			else
    			{
    				echo 'Le dossier de l illustration small n existe pas.';
    			}
     
     
     
     
     
    	}
    ?>
    on m'a dit que ca pouvait venir d'une erreur de code, comme une boucle.

    voici l'appel de la fonction:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
     
    <?php
    //verifie si les variables existent si c est un ajout ou une modification
    if (isset ($_POST['id_rubrique_annonce'])and isset ($_POST['titre_annonce'])and isset ($_POST['description_annonce'])
     and isset ($_POST['prix_annonce']) and isset ($_POST['id_inscrit_annonce'])and isset ($_POST['id_annonce']))
    {
     
    if(isset($_FILES['fichier']))
    {
    $_POST['illustration_annonce']=$_POST['id_inscrit_annonce'].'-'.$_POST['id_annonce'].'-'.'home.jpeg';
    }
    	$annonce = new Annonce (
    	array (
    	'id_rubrique_annonce' => ($_POST['id_rubrique_annonce']),
    	'etat_annonce' => ($_POST['etat_annonce']),
    	'titre_annonce' => ($_POST['titre_annonce']),
    	'description_annonce' => ($_POST['description_annonce']),
    	'prix_annonce' => ($_POST['prix_annonce']),
    	'illustration_annonce' => $_POST['illustration_annonce'],
    	'id_inscrit_annonce' => ($_POST['id_inscrit_annonce'])
     
    	)
    	);
     
     
    	if (isset($_POST['id_annonce']))
    	$annonce->setIdAnnonce($_POST['id_annonce']);
     
     
    	//verifie si les variables ne sont pas vide
    	if ($annonce->isValid())
    	{
     
    		$managerAnnonce->save($annonce);
     
    		$message = $annonce->isAnnonce() ? 'L Annonce a bien &eacute;t&eacute; ajout&eacute;e !' : 'L Annonce a bien &eacute;t&eacute; modifi&eacute;e !';
     
    		if (isset($_FILES['fichier']))
    		{
    		$managerAnnonce->upload($_FILES,$_POST['id_annonce'],$_POST['id_inscrit_annonce']);
    		}
    	}
    	else
     
    	$erreurs = $annonce->erreurs();
     
    }
    ?>
    merci.

  2. #2
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 726
    Points
    10 726
    Par défaut
    tu charges une image qui est trop grande (pas grosse, grande), il va falloir accepter des images de petite en résolution, GD prend beaucoup de mémoire

Discussions similaires

  1. Installation ZendFramework : Fatal error: Out of memory
    Par Jarodd dans le forum Zend Framework
    Réponses: 0
    Dernier message: 14/11/2012, 21h51
  2. [PHPExcel] PHP Fatal error: Out of memory
    Par bdptakix dans le forum Bibliothèques et frameworks
    Réponses: 2
    Dernier message: 12/09/2012, 10h20
  3. Fatal error: Out of memory
    Par Jonathan.Harvey dans le forum Général Java
    Réponses: 4
    Dernier message: 28/03/2011, 17h48
  4. Error out of memory!
    Par jamsgoodon dans le forum Langage
    Réponses: 7
    Dernier message: 28/05/2010, 14h42
  5. "GLUT Fatal Error: out of memory" sous Mac OS
    Par shams dans le forum GLUT
    Réponses: 3
    Dernier message: 26/04/2007, 14h03

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo