I am getting the following error when I run my script
php cannot be displayed because it contains errors
The script, takes a file, resizes it outputs it to screen and a file.
url_example: localhost/testimage.php?img=img_592_121_200.jpg
I have read most posts and tried proposed solutions. all Failed
The file will not output to screen/browser but it can gets save to a file.
Here is the code, I stripped all the white space off and empty lines. and hard-coded the file name inside the script
**Am starting to suspect it is my setup, but am not sure to even to how/where to start looking
Edit : simplified to go to output to screen only
testimage.php
<?php
//session_start();
//ob_start();
ini_set("display_errors", "1");
error_reporting(E_ALL);
Header('Content-type:image/jpeg');
//$cacheFile="mypicXXX.jpg";
//$cache_dir="cache/1/592/";
$img_dir="webspace/1/592/";
$img="img_592_121.jpg";
$id="$img_dir$img";
$src=imagecreatefromjpeg($id);
$new_width=200;
$new_height=77;
$width=600;
$height=1001;
$w_src=600;
$h_src=1001;
$img=imagecreatetruecolor($new_width,$new_height);
imagecopyresampled($img,$src,0,0,0,0,$new_width,$new_height,$w_src,$h_src);
imagejpeg($img,NULL,45);
//$cacheFile=$cache_dir.$cacheFile;
//imagejpeg($img,$cacheFile,45);
imagedestroy($src);
imagedestroy($img);
//ob_end_flush();
?>