Bonjour,

J'ai un hébergement chez Net4all.ch qui mentionne dans le phpinfo 32M de memory_limit

Le problème c'est que lorsque j'envoie une photo de 2.5Mo par exemple, le script plante :
Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 600 bytes) in /var/www/vhosts/www.mondomaine.com/web/upload.php on line 130
Est-ce que c'est normal par rapport à la limite de 32Mo ou est-ce qu'il y a quelque chose que je fais de mal dans mon script ?

Une partie de mon script :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
if (in_array($_FILES["userfile"]["type"], array("image/jpeg", "image/pjpeg"))) {
$imagepath = "images_temp/pouet.jpg";
move_uploaded_file($_FILES['userfile']['tmp_name'],$imagepath);
chmod ($imagepath, 0644);
$image_source = imageCreateFromJpeg($imagepath);
$thumb_destination=ImageCreateTrueColor($new_thumb_width,$new_thumb_height) OR die("Pas pu faire ImageCreateTrueColor");
Le script plante en général sur une des 2 dernières lignes (imageCreateFromJpeg ou ImageCreateTrueColor)

Merci d'avance, je craque !

Nostromo