A
Anonymous
Guest
I had a set up that worked fine. Having returned from a period away I have some problems. GD won't load an image from the local server. It will open an image from another server and another server can open an image from the faulty server. My host claims to have made no changes while I was away.
Running PHP Version 4.3.6, GD Version 2.0.22 on SunOS ray 5.9 Generic_112233-11 sun4u. (full php info at http://www.tamariskfarm.com/construction/info.php)
Test code:
I wrote a php file that outputted the requested image file. When this was running on an external server it worked fine but when on the local server didn't work with GD (it showed the image perfectly when accessed directly).
An ideas? This has really confused me...
Samuel Simon
Running PHP Version 4.3.6, GD Version 2.0.22 on SunOS ray 5.9 Generic_112233-11 sun4u. (full php info at http://www.tamariskfarm.com/construction/info.php)
Test code:
Code:
<?php
$filename = 'test.jpg';
//Doesn't work
//test.jpg is in the same directory as the php file and both the directory and the files have permissions set to 0777
//$filename = 'http://www.tamariskfarm.com/construction/resize/test.jpg';
//Doesn't work when run from local host. When I take this php file and run from another server it works fine with this path.
//$filename = 'http://us.i1.yimg.com/us.yimg.com/i/buzz/2005/09/0924cowboycheerleaderssmall.jpg';
//Works fine taking the image from a yahoo server, or any other server I have tried.
if ($image = @imagecreatefromjpeg($filename))
{
header("HTTP/1.1 202 Accepted");
header('Content-type: image/jpeg');
imagejpeg($image, '', 100);
imagedestroy($image);
}
else
{
echo '<h1>ERROR</h1>';
echo 'filename : '.$filename.'<br>';
echo 'fileowner : ' . fileowner($filename) . '<br>';
echo 'fileperms : ' . substr(sprintf('%o', fileperms($filename)), -4) . '<br>';
echo 'is_readable: ' . is_readable($filename) . '<br>';
echo '<img src="'.$filename.'" alt="Image failed to load"><br>';
}
?>
I wrote a php file that outputted the requested image file. When this was running on an external server it worked fine but when on the local server didn't work with GD (it showed the image perfectly when accessed directly).
An ideas? This has really confused me...
Samuel Simon