468,249 Members | 1,509 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

GD Installation problem

Hi,

I'm haveing some problems I'm trying to generate bar charts dynamically by
pulling data from an MS Access databasae using an ODBC connection and then
generating the bar charts, this is all on WinXP Pro by the way. I have no
problems with getting the data out of the database and sorting it. I was
using this tutorial
http://www.phpbuilder.com/columns/wi...r20001218.php3 as a guidline to
generating the images, but nothing seems to be working for me.
My problem is that I cannot generate any images using any of the
GD image functions. I have loaded the php_gd2.dll in the php.ini file and I
can see that the dll is loaded when I do a phpinfo(); the probelm is that
none of the pages are generating any images.
I would be greatful if somebody would be able to assist.

Thanks,

Tony


Jul 17 '05 #1
5 1528
On Wed, 10 Nov 2004 21:18:24 -0000, "Tony Clarke" <cl*****@eircom.net> wrote:
I'm haveing some problems I'm trying to generate bar charts dynamically by
pulling data from an MS Access databasae using an ODBC connection and then
generating the bar charts, this is all on WinXP Pro by the way. I have no
problems with getting the data out of the database and sorting it. I was
using this tutorial
http://www.phpbuilder.com/columns/wi...r20001218.php3 as a guidline to
generating the images, but nothing seems to be working for me.
My problem is that I cannot generate any images using any of the
GD image functions. I have loaded the php_gd2.dll in the php.ini file and I
can see that the dll is loaded when I do a phpinfo(); the probelm is that
none of the pages are generating any images.
I would be greatful if somebody would be able to assist.


Example code? What errors do you get? What happens when you try to view the
images? Have you sent the right content-type header? Are there PHP error
messages being produced (this corrupts the image)?

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
I dont get any errors, doing a phpinfo(); shows GD installed. I use a html
with an <img> tag to call the php file that is supposed to generate the
image. Example code below is saved in a file called chart.php and use the
img src tag to call it. On the html page I just get a space as if the html
page could not find the image. Any help would be greatly appreciated.

<HTML>
<BODY>
<H1>RMAs Raised</H1>
<IMG SRC="test1.php" HEIGHT="250" WIDTH="480">
</BODY>
</HTML>
<?php
//-------------------- chart.php file
header ("Content-type: image/png");
$img_handle = ImageCreate (230, 20) or die ("Cannot Create image");
$back_color = ImageColorAllocate ($img_handle, 0, 10, 10);
$txt_color = ImageColorAllocate ($img_handle, 233, 114, 191);
ImageString ($img_handle, 31, 5, 5, "My first Program with GD",
$txt_color);
ImagePng ($img_handle);
?>

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:i8********************************@4ax.com...
On Wed, 10 Nov 2004 21:18:24 -0000, "Tony Clarke" <cl*****@eircom.net> wrote:
I'm haveing some problems I'm trying to generate bar charts dynamically bypulling data from an MS Access databasae using an ODBC connection and thengenerating the bar charts, this is all on WinXP Pro by the way. I have noproblems with getting the data out of the database and sorting it. I was
using this tutorial
http://www.phpbuilder.com/columns/wi...r20001218.php3 as a guidline togenerating the images, but nothing seems to be working for me.
My problem is that I cannot generate any images using any of theGD image functions. I have loaded the php_gd2.dll in the php.ini file and Ican see that the dll is loaded when I do a phpinfo(); the probelm is that
none of the pages are generating any images.
I would be greatful if somebody would be able to assist.

Example code? What errors do you get? What happens when you try to view the images? Have you sent the right content-type header? Are there PHP error
messages being produced (this corrupts the image)?

Jul 17 '05 #3
Sorry, that image tag below should be
<IMG SRC="chart.php" HEIGHT="250" WIDTH="480">


"Tony Clarke" <cl*****@eircom.net> wrote in message
news:gY*******************@news.indigo.ie...
I dont get any errors, doing a phpinfo(); shows GD installed. I use a html
with an <img> tag to call the php file that is supposed to generate the
image. Example code below is saved in a file called chart.php and use the
img src tag to call it. On the html page I just get a space as if the html
page could not find the image. Any help would be greatly appreciated.

<HTML>
<BODY>
<H1>RMAs Raised</H1>
<IMG SRC="test1.php" HEIGHT="250" WIDTH="480">
</BODY>
</HTML>
<?php
//-------------------- chart.php file
header ("Content-type: image/png");
$img_handle = ImageCreate (230, 20) or die ("Cannot Create image"); $back_color = ImageColorAllocate ($img_handle, 0, 10, 10);
$txt_color = ImageColorAllocate ($img_handle, 233, 114, 191);
ImageString ($img_handle, 31, 5, 5, "My first Program with GD",
$txt_color);
ImagePng ($img_handle);
?>

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:i8********************************@4ax.com...
On Wed, 10 Nov 2004 21:18:24 -0000, "Tony Clarke" <cl*****@eircom.net> wrote:
I'm haveing some problems I'm trying to generate bar charts dynamically by
pulling data from an MS Access databasae using an ODBC connection and thengenerating the bar charts, this is all on WinXP Pro by the way. I have noproblems with getting the data out of the database and sorting it. I
wasusing this tutorial
http://www.phpbuilder.com/columns/wi...r20001218.php3 as a guidline
togenerating the images, but nothing seems to be working for me.
My problem is that I cannot generate any images using any
of
theGD image functions. I have loaded the php_gd2.dll in the php.ini file
and
Ican see that the dll is loaded when I do a phpinfo(); the probelm is

thatnone of the pages are generating any images.
I would be greatful if somebody would be able to assist.

Example code? What errors do you get? What happens when you try to view

the
images? Have you sent the right content-type header? Are there PHP error
messages being produced (this corrupts the image)?


Jul 17 '05 #4


Tony Clarke wrote:

I dont get any errors, doing a phpinfo(); shows GD installed. I use a html
with an <img> tag to call the php file that is supposed to generate the
image. Example code below is saved in a file called chart.php and use the
img src tag to call it. On the html page I just get a space as if the html
page could not find the image. Any help would be greatly appreciated.

<HTML>
<BODY>
<H1>RMAs Raised</H1>
<IMG SRC="test1.php" HEIGHT="250" WIDTH="480">
</BODY>
</HTML>

<?php
//-------------------- chart.php file
header ("Content-type: image/png");
$img_handle = ImageCreate (230, 20) or die ("Cannot Create image");
$back_color = ImageColorAllocate ($img_handle, 0, 10, 10);
$txt_color = ImageColorAllocate ($img_handle, 233, 114, 191);
ImageString ($img_handle, 31, 5, 5, "My first Program with GD",
$txt_color);
ImagePng ($img_handle);
?>

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:i8********************************@4ax.com...
On Wed, 10 Nov 2004 21:18:24 -0000, "Tony Clarke" <cl*****@eircom.net>

wrote:
I'm haveing some problems I'm trying to generate bar charts dynamically bypulling data from an MS Access databasae using an ODBC connection and thengenerating the bar charts, this is all on WinXP Pro by the way. I have noproblems with getting the data out of the database and sorting it. I was
using this tutorial
http://www.phpbuilder.com/columns/wi...r20001218.php3 as a guidline togenerating the images, but nothing seems to be working for me.
My problem is that I cannot generate any images using any of theGD image functions. I have loaded the php_gd2.dll in the php.ini file and Ican see that the dll is loaded when I do a phpinfo(); the probelm is that
none of the pages are generating any images.
I would be greatful if somebody would be able to assist.

Example code? What errors do you get? What happens when you try to view

the
images? Have you sent the right content-type header? Are there PHP error
messages being produced (this corrupts the image)?


Try commenting out the header() line, make sure error reporting is on and see
what's up. That should give you a human-readable error. I'm asssuming you have
your paths right (your 2 files have to be in the same directory)...

Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #5
On Wed, 10 Nov 2004 22:51:36 -0000, "Tony Clarke" <cl*****@eircom.net> wrote:
I dont get any errors, doing a phpinfo(); shows GD installed. I use a html
with an <img> tag to call the php file that is supposed to generate the
image. Example code below is saved in a file called chart.php and use the
img src tag to call it. On the html page I just get a space as if the html
page could not find the image. Any help would be greatly appreciated.

<HTML>
<BODY>
<H1>RMAs Raised</H1>
<IMG SRC="test1.php" HEIGHT="250" WIDTH="480">
</BODY>
</HTML>
<?php
//-------------------- chart.php file
These are two separate files, right?
Also the <img> references test1.php whereas the comment says this is
chart.php.
header ("Content-type: image/png");
If image creation is going wrong, it can be useful to comment out the
content-type header line so you get it dumped out as text - that way you'll see
any error messages.
$img_handle = ImageCreate (230, 20) or die ("Cannot Create image");
$back_color = ImageColorAllocate ($img_handle, 0, 10, 10);
$txt_color = ImageColorAllocate ($img_handle, 233, 114, 191);
ImageString ($img_handle, 31, 5, 5, "My first Program with GD",
$txt_color);
ImagePng ($img_handle);
?>


--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by MichaƂ Januszczyk | last post: by
2 posts views Thread by mb12036 | last post: by
2 posts views Thread by news.symantec.com | last post: by
4 posts views Thread by Will Honea | last post: by
4 posts views Thread by James | last post: by
2 posts views Thread by =?Utf-8?B?R3JlZw==?= | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.