Upload Problem mit PHP Version?

crashx

Erfahrenes Mitglied
Hallo erst mal :)

Ich habe wieder mal das mit Euch erarbeitete Uploadscript verwendet.
Alles lief Prima! leider zu gut.

auf meinem Localhost läuft alles perfekt nit der PHP Version 5.0.5
Also alles auf den Server.
Nix geht mehr! auch keine Fehler meldung mit error_reporting(E_ALL);
Ich habe 6 Std. lang herum gebastelt und getüftelt nichts geht :(
Es lassen sich Lediglich Bilder in der Grösse um 20 - 30 kb korrekt hochladen.
Also habe ich eine test.php mit dem Uploadscript gemacht und sie auf den Problem Server und einen anderen Hochgeladen auf dem anderen lief alles! Perfekt.
Ich schliesse daraus das es ein Problem mit den PHP einstellungen sein muss.
Da ich Leider null ahnung habe und aus der phpinfo nicht schlau werde, hoffe ich das Ihr mir weiter Helfen könnt.

Problem Server:
Upload Script Testen auf dem Problem Server
phpinfo() des Problem Server

Anderer Server bei dem es geht.
Upload Script
phpinfo()

Und noch die test.php
PHP:
<?PHP
if(isset($_POST['check']))
	{
		$true =1;
	}
if($true)
	{


$datum = date("dmy");
$zeit = date("His");
$dat = $datum.$zeit;
$src = $_GET['src'];
if (isset($_FILES)) 
	{
		for($i = 0; $i < count($_FILES['file']['tmp_name']); ++$i)
			{
				$tempname = $_FILES['file']['tmp_name'][$i];
				$name     = $_FILES['file']['name'][$i];
				$size = getimagesize("$tempname");
				$getsize = $_FILES['file']['size'][$i];
				
				if (!copy($tempname, 'pic/temp_'.$name)) 
					{
					}
					
						$dir = "pic/";
						$original = "temp_$name";
						$get_data = getimagesize("$dir"."$original");
						
						if($get_data[2]==1)
							{
							$original_temp = imagecreatefromgif("$dir"."$original"); 
            				
  							$height_orig = $get_data[1];
  							$width_orig = $get_data[0];
  							$width = 500;
  								if($width_orig > $height_orig)
  									{
  										$width = 500;
  									}else{
  										$width = 300;
  									}
  							$height = intval($height_orig*$width/$width_orig); 

            					if ($width && ($width_orig < $height_orig)) 
            						{ 
               						$width = ($height / $height_orig) * $width_orig; 
             						} 
             					else 
            						{ 
               						$height = ($width / $width_orig) * $height_orig; 
             						} 
 
             				$newOriginal =  imagecreatetruecolor($width, $height); 

             				imagecopyresampled($newOriginal, $original_temp, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); 

             				imagegif($newOriginal, "$dir"."$dat$name", 100);
         
            				}
            				
            				if($get_data[2]==2)
							{
							$original_temp = imagecreatefromjpeg("$dir"."$original"); 
            				
  							$height_orig = $get_data[1];
  							$width_orig = $get_data[0];
  							$width = 500;
  								if($width_orig > $height_orig)
  									{
  										$width = 500;
  									}else{
  										$width = 300;
  									}
  							$height = intval($height_orig*$width/$width_orig); 

            					if ($width && ($width_orig < $height_orig)) 
            						{ 
               						$width = ($height / $height_orig) * $width_orig; 
             						} 
             					else 
            						{ 
               						$height = ($width / $width_orig) * $height_orig; 
             						} 
 
             				$newOriginal =  imagecreatetruecolor($width, $height); 

             				imagecopyresampled($newOriginal, $original_temp, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); 

             				imagejpeg($newOriginal, "$dir"."$dat$name", 100);
         
            				}
							
							if($get_data[2]==3)
							{
							$original_temp = imagecreatefrompng("$dir"."$original"); 
            				
  							$height_orig = $get_data[1];
  							$width_orig = $get_data[0];
  							$width = 500;
  								if($width_orig > $height_orig)
  									{
  										$width = 500;
  									}else{
  										$width = 300;
  									}
  							$height = intval($height_orig*$width/$width_orig); 

            					if ($width && ($width_orig < $height_orig)) 
            						{ 
               						$width = ($height / $height_orig) * $width_orig; 
             						} 
             					else 
            						{ 
               						$height = ($width / $width_orig) * $height_orig; 
             						} 
 
             				$newOriginal =  imagecreatetruecolor($width, $height); 

             				imagecopyresampled($newOriginal, $original_temp, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); 

             				imagepng($newOriginal, "$dir"."$dat$name", 100);
         
            				}

            					
            					$delete = "$dir"."temp_$name";
								unlink($delete); 
						
						//Hier endet das Original bearbeiten.
							
						
					
				if (is_uploaded_file($tempname)) 
          			{ 
						if($size[2]==1)
							{
							$im_temp = imagecreatefromgif($tempname); 
            				
  							$height_orig = $size[1];
  							$width_orig = $size[0];
  							$width = 80;
  							if($width_orig > $height_orig)
  									{
  										$width = 80;
  									}else{
  										$width = 50;
  									}
  							$height = intval($height_orig*$width/$width_orig); 

            					if ($width && ($width_orig < $height_orig)) 
            						{ 
               						$width = ($height / $height_orig) * $width_orig; 
             						} 
             					else 
            						{ 
               						$height = ($width / $width_orig) * $height_orig; 
             						} 
 
             				$newImg =  imagecreatetruecolor($width, $height); 

             				imagecopyresampled($newImg, $im_temp, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); 

             				imagegif($newImg, "$tempname", 100); 

             				move_uploaded_file($tempname,"thumb/thumb_$dat$name"); 
            				}
            			if($size[2]==2)
							{
							$im_temp = imagecreatefromjpeg($tempname); 
            				
  							$height_orig = $size[1];
  							$width_orig = $size[0];
  							$width = 80;
  							if($width_orig > $height_orig)
  									{
  										$width = 80;
  									}else{
  										$width = 50;
  									}
  							$height = intval($height_orig*$width/$width_orig); 

            					if ($width && ($width_orig < $height_orig)) 
            						{ 
               						$width = ($height / $height_orig) * $width_orig; 
             						} 
             					else 
            						{ 
               						$height = ($width / $width_orig) * $height_orig; 
             						} 
 
             				$newImg =  imagecreatetruecolor($width, $height); 

             				imagecopyresampled($newImg, $im_temp, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); 

             				imagejpeg($newImg, "$tempname", 100); 

             				move_uploaded_file($tempname,"thumb/thumb_$dat$name"); 
            				}
						if($size[2]==3)
							{
							$im_temp = imagecreatefrompng($tempname); 
            				
  							$height_orig = $size[1];
  							$width_orig = $size[0];
  							$width = 80;
  							if($width_orig > $height_orig)
  									{
  										$width = 80;
  									}else{
  										$width = 50;
  									}
  							$height = intval($height_orig*$width/$width_orig); 

            					if ($width && ($width_orig < $height_orig)) 
            						{ 
               						$width = ($height / $height_orig) * $width_orig; 
             						} 
             					else 
            						{ 
               						$height = ($width / $width_orig) * $height_orig; 
             						} 
 
             				$newImg =  imagecreatetruecolor($width, $height); 

             				imagecopyresampled($newImg, $im_temp, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); 

             				imagepng($newImg, "$tempname", 100); 

             				move_uploaded_file($tempname,"thumb/thumb_$dat$name"); 
            				}
					}
            				
					 
        	}
	}
error_reporting(E_ALL);
echo '<img src="pic/'.$dat.$name.'" border="0"><br>';
echo '<img src="thumb/thumb_'.$dat.$name.'" border="0">';

	}
else
	{
		echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post" enctype="multipart/form-data">';
		echo '<input type="file" name="file[]">';
		echo '<input type="submit" name="send" value="upload">';
		echo '<input type="hidden" name="check" value="1">';
		echo '</form>';
	}
?>
 
Hallo,

ich hatte das selbe Problem bei mir lag es an den Dateizugriffsrechte, sind die auf schreiben und lesen?

MfG proloser
 
Der Technicker meines Hostinganbieteres meint es sein ein Fehler im Script!
Ich habe jedoch keine Ahnung wo das problem liegen könnte :(

Hier nochmal das Uploadscript:
PHP:
<?PHP
if(isset($_POST['check']))
	{
		$true =1;
	}
if($true)
	{


$datum = date("dmy");
$zeit = date("His");
$dat = $datum.$zeit;
$src = $_GET['src'];
if (isset($_FILES)) 
	{
		for($i = 0; $i < count($_FILES['file']['tmp_name']); ++$i)
			{
				$tempname = $_FILES['file']['tmp_name'][$i];
				$name     = $_FILES['file']['name'][$i];
				$size = getimagesize("$tempname");
				$getsize = $_FILES['file']['size'][$i];
				
				if (!copy($tempname, 'pic/temp_'.$name)) 
					{
					}
					
						$dir = "pic/";
						$original = "temp_$name";
						$get_data = getimagesize("$dir"."$original");
						
						if($get_data[2]==1)
							{
							$original_temp = imagecreatefromgif("$dir"."$original"); 
            				
  							$height_orig = $get_data[1];
  							$width_orig = $get_data[0];
  							$width = 500;
  								if($width_orig > $height_orig)
  									{
  										$width = 500;
  									}else{
  										$width = 300;
  									}
  							$height = intval($height_orig*$width/$width_orig); 

            					if ($width && ($width_orig < $height_orig)) 
            						{ 
               						$width = ($height / $height_orig) * $width_orig; 
             						} 
             					else 
            						{ 
               						$height = ($width / $width_orig) * $height_orig; 
             						} 
 
             				$newOriginal =  imagecreatetruecolor($width, $height); 

             				imagecopyresampled($newOriginal, $original_temp, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); 

             				imagegif($newOriginal, "$dir"."$dat$name", 100);
         
            				}
            				
            				if($get_data[2]==2)
							{
							$original_temp = imagecreatefromjpeg("$dir"."$original"); 
            				
  							$height_orig = $get_data[1];
  							$width_orig = $get_data[0];
  							$width = 500;
  								if($width_orig > $height_orig)
  									{
  										$width = 500;
  									}else{
  										$width = 300;
  									}
  							$height = intval($height_orig*$width/$width_orig); 

            					if ($width && ($width_orig < $height_orig)) 
            						{ 
               						$width = ($height / $height_orig) * $width_orig; 
             						} 
             					else 
            						{ 
               						$height = ($width / $width_orig) * $height_orig; 
             						} 
 
             				$newOriginal =  imagecreatetruecolor($width, $height); 

             				imagecopyresampled($newOriginal, $original_temp, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); 

             				imagejpeg($newOriginal, "$dir"."$dat$name", 100);
         
            				}
							
							if($get_data[2]==3)
							{
							$original_temp = imagecreatefrompng("$dir"."$original"); 
            				
  							$height_orig = $get_data[1];
  							$width_orig = $get_data[0];
  							$width = 500;
  								if($width_orig > $height_orig)
  									{
  										$width = 500;
  									}else{
  										$width = 300;
  									}
  							$height = intval($height_orig*$width/$width_orig); 

            					if ($width && ($width_orig < $height_orig)) 
            						{ 
               						$width = ($height / $height_orig) * $width_orig; 
             						} 
             					else 
            						{ 
               						$height = ($width / $width_orig) * $height_orig; 
             						} 
 
             				$newOriginal =  imagecreatetruecolor($width, $height); 

             				imagecopyresampled($newOriginal, $original_temp, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); 

             				imagepng($newOriginal, "$dir"."$dat$name", 100);
         
            				}

            					
            					$delete = "$dir"."temp_$name";
								unlink($delete); 
						
						//Hier endet das Original bearbeiten.
							
						
					
				if (is_uploaded_file($tempname)) 
          			{ 
						if($size[2]==1)
							{
							$im_temp = imagecreatefromgif($tempname); 
            				
  							$height_orig = $size[1];
  							$width_orig = $size[0];
  							$width = 80;
  							if($width_orig > $height_orig)
  									{
  										$width = 80;
  									}else{
  										$width = 50;
  									}
  							$height = intval($height_orig*$width/$width_orig); 

            					if ($width && ($width_orig < $height_orig)) 
            						{ 
               						$width = ($height / $height_orig) * $width_orig; 
             						} 
             					else 
            						{ 
               						$height = ($width / $width_orig) * $height_orig; 
             						} 
 
             				$newImg =  imagecreatetruecolor($width, $height); 

             				imagecopyresampled($newImg, $im_temp, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); 

             				imagegif($newImg, "$tempname", 100); 

             				move_uploaded_file($tempname,"thumb/thumb_$dat$name"); 
            				}
            			if($size[2]==2)
							{
							$im_temp = imagecreatefromjpeg($tempname); 
            				
  							$height_orig = $size[1];
  							$width_orig = $size[0];
  							$width = 80;
  							if($width_orig > $height_orig)
  									{
  										$width = 80;
  									}else{
  										$width = 50;
  									}
  							$height = intval($height_orig*$width/$width_orig); 

            					if ($width && ($width_orig < $height_orig)) 
            						{ 
               						$width = ($height / $height_orig) * $width_orig; 
             						} 
             					else 
            						{ 
               						$height = ($width / $width_orig) * $height_orig; 
             						} 
 
             				$newImg =  imagecreatetruecolor($width, $height); 

             				imagecopyresampled($newImg, $im_temp, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); 

             				imagejpeg($newImg, "$tempname", 100); 

             				move_uploaded_file($tempname,"thumb/thumb_$dat$name"); 
            				}
						if($size[2]==3)
							{
							$im_temp = imagecreatefrompng($tempname); 
            				
  							$height_orig = $size[1];
  							$width_orig = $size[0];
  							$width = 80;
  							if($width_orig > $height_orig)
  									{
  										$width = 80;
  									}else{
  										$width = 50;
  									}
  							$height = intval($height_orig*$width/$width_orig); 

            					if ($width && ($width_orig < $height_orig)) 
            						{ 
               						$width = ($height / $height_orig) * $width_orig; 
             						} 
             					else 
            						{ 
               						$height = ($width / $width_orig) * $height_orig; 
             						} 
 
             				$newImg =  imagecreatetruecolor($width, $height); 

             				imagecopyresampled($newImg, $im_temp, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); 

             				imagepng($newImg, "$tempname", 100); 

             				move_uploaded_file($tempname,"thumb/thumb_$dat$name"); 
            				}
					}
            				
					 
        	}
	}
error_reporting(E_ALL);
echo '<img src="pic/'.$dat.$name.'" border="0"><br>';
echo '<img src="thumb/thumb_'.$dat.$name.'" border="0">';

	}
else
	{
		echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post" enctype="multipart/form-data">';
		echo '<input type="file" name="file[]">';
		echo '<input type="submit" name="send" value="upload">';
		echo '<input type="hidden" name="check" value="1">';
		echo '</form>';
	}
?>

Hier geht das script nicht!
http://www.exclusive-by-rossi.ch/test/test.php

und hier geht es:
http://www.bucherschnaepchen.ch/test/test.php

Ich wäre euch sehr Dankbar wenn mir jemand Helfen könnte.
 
@proloser
Versuche mal ein grösseres bild hochzuladen ab 600kb
Ich habe den 1 link nochmal probiert, geht immer noch ned!

Wo der Fehler liegt, weiss ich einfach nicht. denn bei mir PHP v. 5.2.0 geht auch alles ohne Problem
 
Zurück