PHP fails when moved to remote server?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Harry57
Forum Newbie
Posts: 2
Joined: Tue Oct 28, 2008 4:35 pm

PHP fails when moved to remote server?

Post 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>";
?>
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: PHP fails when moved to remote server?

Post by yacahuma »

i dont know if those routines need the gd library install

check your php.ini and the hosting one
Harry57
Forum Newbie
Posts: 2
Joined: Tue Oct 28, 2008 4:35 pm

Re: PHP fails when moved to remote server?

Post by Harry57 »

Thanks - but the docs say that GD is not required for either getimagesize or iptcparse.
Post Reply