Forum Moderators: phranque

Message Too Old, No Replies

php GD library in Apache

configure gd2 library

         

pardel

12:41 pm on May 24, 2005 (gmt 0)

10+ Year Member



Hi all,

I've followed the instruction to enable the GD library.
Everything went fine and GD modules appears when I run php -m.
BUT, then loading apache it does not appear in the module list generated by:
<?php
phpinfo(INFO_MODULES);
?>
If I try to use it with JPGraph I get an errors saying the the PHP installation is not configured with the GD library.
I am using Apache 1.3.33 with PHP 4.3.11.
Any advice?

Thank you!
Paul

pardel

12:43 pm on May 24, 2005 (gmt 0)

10+ Year Member



Forgot to mention this is on Windows XP SP2.
Cheers!

coopster

11:32 am on May 25, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, pardel.

The command you issued with the -m switch will show "compiled in modules" but not necessarily those that have been enabled. You need to uncomment the gd extension .dll in your php.ini configuration file and make sure the extension itself can be found in the php path (the latter typically means you have to copy the extension file (php_gd2.dll) out of the /php/ext/ folder and into the php path, usually /php.

pardel

11:50 am on May 25, 2005 (gmt 0)

10+ Year Member



Hi coopster,
Thanks for your answer.
I have completed all the required steps and still nothing.
I just realized that no extra modules (apart from the standard ones) are loading by Apache: even if I change the name of the gd dll to something inexistent, Apache does not return an error.
Not sure why this is happening.

pardel

12:11 pm on May 26, 2005 (gmt 0)

10+ Year Member



Hi again,

Manage to sort this by simply copying php.ini from php folder to apache folder. Now all php extensions are loading.
HURRAY!

;)

coopster

10:08 pm on May 26, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Good for you, nice work. Yes, making sure your php.ini file is found and processed correctly is a common mistake. PHP and Apache 2.0 has made it much easier with it's own directive, PHPIniDir. As a matter of fact, if you are going to run Apache on Windows, you are probably better off running 2.0. Read the comments in the second link below ...

[php.net...]
[php.net...]


Although the warning above reads "We do not recommend using a threaded MPM in production with Apache2" - ignore that nonsense for Win32.

All Apache/Win32 builds were *always* threaded. Always choose Apache 2 over Apache 1.3 on Windows - because major portions of Apache 2 were written from the ground up to accept Windows.

Apache 1.3 was never designed for threads or non-posix systems. For Windows they were squirled in with some rather ugly hacks, which will never enjoy much improvement.

pardel

8:37 am on May 27, 2005 (gmt 0)

10+ Year Member



Weird.. but I cannot see anywhere something about moving php.ini file.

coopster

2:00 pm on May 27, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Have you read through the full Windows installation [php.net]?