Page 1 of 1

PHP fails when moved to remote server?

Posted: Tue Oct 28, 2008 4:38 pm
by Harry57
I have looked at this code till my eyes pop and can't see what's wrong.
The php code below to return image height works fine on my local XAMPP server but when moved to the shared isp hosting does not return any values. Same with the code to return IPTC Caption.
I conclude that getimagesize and or iptcparse are not running, but why?
I've checked and checked.

Any ideas about what areas to investigate would be very welcome :(


if (empty($_GET['photo']))
{echo "<img src='/rand/rand_image.pl' alt='featured image' /> "; // } On first display of page, start with a random image of known height
}
else {
$imageName= "images/asia/{$_GET['photo']}";
echo "<img src='$imageName' alt='' /> "; //otherwise display image corresponding to selected thumbnail
}
?>

<?php
list($width, $height) = getimagesize("$imageName");
echo "Height of selected image= ";
echo "$height";
echo "<BR>";
?>

<div id="caption">
<?php
$size = getimagesize ("$imageName",&$info);
$iptc = iptcparse ($info["APP13"]);
if (isset($info["APP13"])) {
$iptc = iptcparse($info["APP13"]);
if (is_array($iptc)) {
$caption = $iptc["2#120"][0];
echo "Caption = " .$caption;
}}
echo "<BR>";
?>

Re: PHP fails when moved to remote server?

Posted: Tue Oct 28, 2008 7:05 pm
by yacahuma
i dont know if those routines need the gd library install

check your php.ini and the hosting one

Re: PHP fails when moved to remote server?

Posted: Wed Oct 29, 2008 10:12 am
by Harry57
Thanks - but the docs say that GD is not required for either getimagesize or iptcparse.