Jump to content

Problem with gd2.dll and xampp

Recommended Posts

Hi all,

im wondering if anyone can shed some ligt on this problem ...

im trying to create dynamic graphs in php. In the php.ini file "extension=php_gd2.dll" is already enabled and I am pointing to the correct directory.

With all this checked I have taken an example out of a book to see at least if an image can be drawn, however I keep getting this error:

Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\dp\testgraph.php:1) in C:\Program Files\xampp\htdocs\dp\testgraph.php on line 15


This is the code:


// set up image

$height = 200;

$width = 200;

$im = ImageCreate($width, $height);

$white = ImageColorAllocate($im,255,255,255);

$black = ImageColorAllocate ($im,0,0,0);

// draw on image

ImageFill($im, 0,0,black);

ImageLine($im, 0, 0, $width, $height, $white);

ImageString($im,4,50,150, 'Sales', $white);

// output image

Header ('Content-type: image/png');

ImagePng ($im);

// clean up



Please Please Please can somebody help. This is driving me crazy.



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.

  • Create New...