Page 1 of 1

PHP 4.3.0. and GD Library. Where to start ?

Posted: Sun Feb 02, 2003 1:09 pm
by Wentu
Hi all !

i just installed PHP from the "php-4.3.0-Win32.zip". I suppose this is the 4.3.0. version.
Now, in the site of the GD Library i read :
*php 4.3.0 is available, and it includes a version of gd as "standard equipment." *

What does this exactly mean ? That i can use the library without installing anything else or what ? I tried one of those simple tutorials on how to create images on the fly with PHP and GDL but it doesnt work. However, when i try other simple PHP pages they work fine. So i think PHP is installed correclty ( on apache server, win XP home ed. ) . What i am missing ?

Here's the code i tried:

<?
$image = ImageCreate(200,150);
$blue = ImageColorAllocate($image,0,0,255);
ImageLine($image, 10,10, 150,30, $blue);

ImageJPEG($image);
?>

what i get is NOTHING. where's the problem ?
thankx very much

Wentu

Posted: Mon Feb 03, 2003 2:21 am
by twigletmac
Is GD listed if you do:

Code: Select all

<?php
print_r (get_loaded_extensions());
?>
Mac

Posted: Mon Feb 03, 2003 2:33 am
by Wentu
Hi.
thankx for the reply

Here's what Your code generates:

Array ( [0] => standard [1] => bcmath [2] => calendar [3] => ctype [4] => com [5] => ftp [6] => mysql [7] => odbc [8] => overload [9] => pcre [10] => session [11] => tokenizer [12] => xml [13] => wddx [14] => zlib )

..soo.. I probably missed something.I got the impression it was all too easy....
Could you tell me what's missing please ?

thank you very Much !!

Wentu

Posted: Mon Feb 03, 2003 3:14 am
by twigletmac
You need to edit your php.ini file (default location C:/WINNT/ or C:/Windows - don't know which convention XP Home uses). By default the extension dll's for GD are installed to the extension directory within the PHP directory so you would need to edit the extension_dir directive to something like:

Code: Select all

extension_dir = C:/PHP/extensions
obviously reflecting wherever those dll's actually are and then you need to uncomment this line:

Code: Select all

;extension=php_gd.dll
by removing the semi-colon in front of it.

Mac

Posted: Tue Feb 04, 2003 2:55 am
by jonecky
.... By default the extension dll's for GD are installed to the extension directory within the PHP directory so you would need to edit the extension_dir directive to something like:

Code: Select all

extension_dir = C:/PHP/extensions
obviously reflecting wherever those dll's actually are and then you need to uncomment this line:

Code: Select all

;extension=php_gd.dll
by removing the semi-colon in front of it.
Mac
Well, I've got exactly the same problem (PHP4.3.0., IIS + XP Pro) and I've done exactly as told concerning about the extensions. But, the install zip package does NOT include ANY dll's inside, so I downloaded php_gd2.dll from internet and placed it into the extensions dir.
Now, I uncommented the line

Code: Select all

;extension=php_gd2.dll
and since it did NOT work either, also tried uncommenting the gd.dll extension line, but... no help. I still can't get gd library to work and after surfing thru internet for a while it really seems there are quite a bunch of people having this very same problem.

Now, is there ANYONE using 4.3.0 (or greater), IIS/Apache + XP who actually have managed to get gd work properly ???? I'm getting a bit more worried... :(

Posted: Tue Feb 04, 2003 3:20 am
by twigletmac
Did you download and install the file called php-4.3.0-Win32.zip? You should definitely have a bunch of dll's in this zip folder.

http://www.php.net/get_download.php?df= ... -Win32.zip

Mac

Posted: Tue May 20, 2003 1:51 pm
by PaulCreedy
I have exactly the same problem

I downloaded php 4.3 from that link and installed it.

GD functions do not work.

I do not have a folder for extensions and I don't have any dll's with the install.

Uncommented the suggested lines tell me that the required dll isn't present.

Any suggestions please?

gd library

Posted: Tue May 20, 2003 6:11 pm
by phpScott
I have apache 2, php 4.3.1 running on windows xp-home and had very little trouble getting to use the gd library.

I have my extensions dir set to
extension_dir = "C:\apache\Apache2\php\extensions"

as my php instalation is in my Apache2 folder.

It also depends on which verison of php you are using as suppost for .gif images has been depricated and you need to use the php_gd2.dll instead of the php_gd.dll

I uncommented
extension=php_gd2.dll

in my php.ini file in my windows directory and it worked just fine.

make sure every thing is where it is suppossed to be and then restart your server so it will reload you php.ini file and find the new settings.

phpScott

Posted: Wed May 21, 2003 3:35 am
by PaulCreedy
Thanks Scott

The problem was that the IIS Windows install version 4.3 (latest version) doesn't come with the dll for GD.

So uncommenting the extension in php.ini doesn't work for us because the php_gd2.dll isn't physically on the disk. Doing this gives the error that the extension cannot be found. Changing the extension path doesn't work because the dll's are just not on the disk anywhere!

I've downloaded the Apache version and it's packed with extensions and DLL's. Unfortunately these are NOT provided in the IIS version. Even though it says it is supplied INCLUDED with the latest version it ISN'T included in the IIS installation version. Something I didn't realise and it took a while to figure this out.

To get it working I had to get the php_gd2.dll from the Apache version and copy it into the PHP folder on Windows. I then uncommented the line in PHP.ini and now it works.

glad

Posted: Wed May 21, 2003 3:41 pm
by phpScott
I'm glad to hear that you got it working, :D :D I was using IIS for a while then found to many problems migrating my code to my unix host.
But what ever works, works.

phpScott