Hi folks,

First post....tried Google but unfortunately my problem doesn't lend to a good search query.

So here's the deal. I'm using WAMP5 for editing locally. I don't have webspace, but right now I don't really need it.

I'm playing with image loading using PHP. I used the direct code from PHP.net to get started:

<?php
function LoadPNG($imgname)
{
    $im = @imagecreatefrompng($imgname); /* Attempt to open */
    if (!$im) { /* See if it failed */
        $im  = imagecreatetruecolor(150, 30); /* Create a blank image */
        $bgc = imagecolorallocate($im, 255, 255, 255);
        $tc  = imagecolorallocate($im, 0, 0, 0);
        imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
        /* Output an errmsg */
        imagestring($im, 1, 5, 5, "Error loading $imgname", $tc);
    }
    return $im;
}
header("Content-Type: image/png");
$img = LoadPNG("KRHMap.png");
imagepng($img);
?> 

Now, when this loads I get no image. All I get is the name of the page. No source code, nothing. The page is called map.php and when it loads all that shows is:

http://localhost/random/map.php

There's no source code, nothing. Is there something in the php.ini file that I have to change in order to get this to work? I really don't feel like buying webspace just to play around if I can do it locally.

Any help is greatly appreciated.

Thanks
Joel

    First question: are the GD image functions enabled in your installation?

      Yeah.....

      I should know of all people to just look around a 'bit' more before posting a question.

      AS it turns out, WAMP doesn't have the GD dll uncommented in the php.ini file.

      A silly mistake on my end, but all is well now. That AND I learned something new...go figure, huh?

      Thanks,

      Joel

        Note that if you have the WAMP icon in your task bar system tray, you can left-click it then select PHP Settings -> PHP Extenstions -> php_gd2 to toggle it on or off.

          Write a Reply...