473,472 Members | 2,191 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Unable to use GD library

29 New Member
Hi,

I wanted to draw some bar charts using php. I have enabled the line
extension=php_gd2.dll in php.ini.
Still not working.
Should I include any path at the top of the script.
What could be the problem?
Pls help

Thanks
Resmi318
Jul 3 '07 #1
16 2786
kovik
1,044 Recognized Expert Top Contributor
What part of it isn't working?

Is it in your phpinfo()?
Does it tell you that GD functions don't exist?
Jul 3 '07 #2
resmi318
29 New Member
What part of it isn't working?

Is it in your phpinfo()?
Does it tell you that GD functions don't exist?
Hi,

It didnt tell GD functions don't exist. When I run the script it is just showing a blank page.

Resmi318
Jul 3 '07 #3
kovik
1,044 Recognized Expert Top Contributor
And what "script" are you running?
Jul 3 '07 #4
Motoma
3,237 Recognized Expert Specialist
Please take a look at the first post in this forum. It describes a method for receiving verbose error messages from PHP where you would normally get a black page.

Post back the error message, as well as the relevant code. Believe me, as hard as it is for you to debug your problem, it is even more difficult for us to do so if we have no information to work with.
Jul 3 '07 #5
kovik
1,044 Recognized Expert Top Contributor
Okay, I don't want everyone PMing me for help. That's what the board is for. I have not read the script that you have sent me.

However, I will give you a simple script to test if GD is, in fact, working.

Expand|Select|Wrap|Line Numbers
  1. $image = imagecreatetruecolor(32, 32);
  2. imagefilledrectangle($image, 0, 0, 32, 32, imagecolorexactalpha($image, 0, 0, 0, 0));
  3. header('Content-Type: image/png');
  4. imagepng($image);
You should get a 32x32 black box.
Jul 3 '07 #6
Motoma
3,237 Recognized Expert Specialist
Okay, I don't want everyone PMing me for help. That's what the board is for. I have not read the script that you have sent me.

However, I will give you a simple script to test if GD is, in fact, working.

Expand|Select|Wrap|Line Numbers
  1. $image = imagecreatetruecolor(32, 32);
  2. imagefilledrectangle($image, 0, 0, 32, 32, imagecolorexactalpha($image, 0, 0, 0, 0));
  3. header('Content-Type: image/png');
  4. imagepng($image);
You should get a 32x32 black box.
An easier test would be a simple call to gd_info().
But before we go test every single little thing that may be causing this error, how about we see if the OP gets any error messages when the debugging is turned on.
Jul 3 '07 #7
Motoma
3,237 Recognized Expert Specialist
READ FIRST: Turn on PHP Debugging Messages
Jul 3 '07 #8
kovik
1,044 Recognized Expert Top Contributor
An easier test would be a simple call to gd_info().
But before we go test every single little thing that may be causing this error, how about we see if the OP gets any error messages when the debugging is turned on.
I was just responding to his PM. It's bad to assume your code is correct and blame other things. gd_info() is a much quicker solution. No idea why it didn't come to mind. Probably because the code he PMed to me was attempted to display an image, so I was thinking in the wrong context.
Jul 3 '07 #9
resmi318
29 New Member
I was just responding to his PM. It's bad to assume your code is correct and blame other things. gd_info() is a much quicker solution. No idea why it didn't come to mind. Probably because the code he PMed to me was attempted to display an image, so I was thinking in the wrong context.
Hi,

I got the following error while I ran the script volectricity send me.

Fatal error: Call to undefined function: imagecreatetruecolor()

Does that mean gd is not enabled or not present with php in my system.

But In php.ini file I saw gd library included ie the line
"extension=php_gd2.dll"

Thanks
Resmi318
Jul 4 '07 #10
kovik
1,044 Recognized Expert Top Contributor
It means that GD is not enabled. Are you sure that php_gd2.dll is in the correct dll path?
Jul 4 '07 #11
nathj
938 Recognized Expert Contributor
Hi Everyone,

I do not wish to hijack this post though I am aware that it may seem like I am. It's just that I need help with the exact same thing. I know that my gd2 stuff is enabled as phpInfo() tells me so (it says Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"). Also gd_info() shows me that stuff isd enabled:
Expand|Select|Wrap|Line Numbers
  1. $array = gd_info();
  2.     foreach ($array as $key => $val)
  3.     {
  4.     if ($key != "GD Version") {
  5.         if ($val == true || $val == false) {
  6.         if ($val == true) {
  7.             $val = "Enabled";
  8.         }
  9.         elseif ($val == false)
  10.         {
  11.             $val = "Disabled";
  12.         }
  13.     }
  14.     }
  15.  
  16.     echo "$key: $val <br />";
  17.  
This returns :
Expand|Select|Wrap|Line Numbers
  1. GD Version: bundled (2.0.34 compatible) 
  2. FreeType Support: Enabled 
  3. FreeType Linkage: Enabled 
  4. T1Lib Support: Enabled 
  5. GIF Read Support: Enabled 
  6. GIF Create Support: Enabled 
  7. JPG Support: Enabled 
  8. PNG Support: Enabled 
  9. WBMP Support: Enabled 
  10. XPM Support: Disabled 
  11. XBM Support: Enabled 
  12. JIS-mapped Japanese Font Support: Disabled 
  13.  
However, the code I have, which draws an image to be used as a security questions (slightly obscured text) works on a host I have for another project but I cannot get it to work locally. I need to have it working locally for testing purposes before I can move to the next stage of development.
Any ideas on what may be missing or incorrectly set up with the php_gd2 dll?
nathj

PS sorry for the hijack, it just seemed better than posting another thread about the same thing.
Jul 5 '07 #12
ak1dnar
1,584 Recognized Expert Top Contributor
Hi,

I got the following error while I ran the script volectricity send me.

Fatal error: Call to undefined function: imagecreatetruecolor()

Does that mean gd is not enabled or not present with php in my system.

But In php.ini file I saw gd library included ie the line
"extension=php_gd2.dll"

Thanks
Resmi318
Do you mean you saw that, is it commented yet?

Expand|Select|Wrap|Line Numbers
  1. ;extension=php_fdf.dll
  2. ;extension=php_filepro.dll
  3.  extension=php_gd2.dll
  4. ;extension=php_gettext.dll
Have you located this php_gd2.dll under ext dir.
Jul 5 '07 #13
resmi318
29 New Member
It means that GD is not enabled. Are you sure that php_gd2.dll is in the correct dll path?
Hi,

Actuallly I am not allowed to make changes in php.ini file. I have asked the administrator and he had taken the comment ";" infront of the statement
extension=php_gd2.dll and restarted the system. Still its not working.
I am using an unix machine .

Thanks
Resmi318
Jul 5 '07 #14
Motoma
3,237 Recognized Expert Specialist
Hi,

Actuallly I am not allowed to make changes in php.ini file. I have asked the administrator and he had taken the comment ";" infront of the statement
extension=php_gd2.dll and restarted the system. Still its not working.
I am using an unix machine .

Thanks
Resmi318
If you are on a UNIX machine, then you will not be using a dll, rather the extension file should end with .so.
Jul 5 '07 #15
resmi318
29 New Member
Do you mean you saw that, is it commented yet?

Expand|Select|Wrap|Line Numbers
  1. ;extension=php_fdf.dll
  2. ;extension=php_filepro.dll
  3.  extension=php_gd2.dll
  4. ;extension=php_gettext.dll
Have you located this php_gd2.dll under ext dir.
Hi,

Yes I saw the way you have mentioned under ext dir.

Resmi318
Jul 6 '07 #16
resmi318
29 New Member
[quote=resmi318]Hi,

Yes I saw the way you have mentioned under ext dir.

Resmi318[/QUOTE
Hi,

In the php.ini file in the extension directory, path specified is /opt/apache/dev/php-4.3.7/lib/php/extensions.
but when I checked , "extensions" folder was not found.
Is that an error in installing php. Should php be reinstalled.

Thanks
Resmi318
Jul 6 '07 #17

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: Nancy | last post by:
Hi, When I start my PC(winXP Pro), it always says: Unknown(): Unable toload dynamic library './php_msql.dll' - The specified module could not be found. Then my Apache servre starts, load php...
2
by: Carlos G Benevides | last post by:
I have a ASP.Net web application that has two assemblies that run under com+. Under Windows 2000 the two assemblies are added to com+ automatically when instantiated from the web site. For this...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichč but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
2
by: Tom wilson | last post by:
I have a W2003 web server running many web applications. One of these uses remote debugging. It works perfectly. Today, I created a new asp.net project. I have 2 problems with it: 1 - Any...
8
by: Carlos Ojea Castro | last post by:
Hello: I'm trying to use kylix3 and postgresql 7.4.1. My distro was Debian Woody, kernel 2.20. I make the link /usr/local/pgsql/lib/libpq.so pointing to libpq.so.2.2 and connection with my...
2
by: peter.mosley | last post by:
A few weeks ago I asked for advice about which GUI toolkit I should learn, and receved several helpful answers. In the end I went with Tkinter. This was because a) it was already installed on the...
0
by: ufnuceda | last post by:
Hello everyone, I was wondering if any of you have some experience with the boost library. I am having trouble compiling code with it. Since boost is being used a lot these days I thought some...
4
by: Abubakar | last post by:
Hi, I'm using vs2k5 vc++ (native/unmanaged). I just took a separate copy of a project from source control (vss) and after fixing its dependencies build it and it builds fine. But when I try to...
3
by: kitemad69 | last post by:
Hello i have downloaded the POS for .NET Library but i am unable to reference it. I have Visual Studio 2005 when i go into my prodject and try reference the library i cannot see the POS for .NET...
9
by: Christopher Koeber | last post by:
Hello, I am attempting to perform a PHP installation on an Apache 2.2.6 web server instance that is loaded on a Windows 2003 server operating system (R2 SP2). I have a third party application...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.