Click to See Complete Forum and Search --> : WINDOWS - PHP works, GD library wont!!!


Local Hero
02-26-2008, 12:23 AM
I spent way to long, but I finally got PHP v5.2.3 running on my Win32 computer. I went to the php.ini file and removed the ; on the extension=php_gd2.dll
I restarted apache, and tried to create a button, the error was:
Fatal error: Call to undefined function imagecreatefrompng()....

My extension_dir = "C:/php/php-5.2.3-Win32/ext" and the php_gd2.dll file is there. I must be missing something

From what I've read online, it would seem that the library isn't installed. When I do a phpinfo(), I don't show any gd library. Is it something that I have to load seperatly? Apart from activating it in the php.ini and having the dll?

I've read 100's of posts and php.net and everyone says it should work, but I can't even show a gd library
Any help or possible ideas are really appreciated

bradgrafelman
02-26-2008, 01:48 AM
1. Where is php.ini located?

2. Does phpinfo() show the correct extension_dir path?

3. Did you add the PHP directory to your system's PATH environment variable (as per the manual's instructions: install.windows.manual) and then restart your computer?

Local Hero
02-26-2008, 09:18 AM
The php.ini file is located in C:/php/php-5.2.3-Win32

In the file I've specified the extension as extension_dir = "C:/php/php-5.2.3-Win32/ext"

In the ext file is the gd library .dll file

When I check the phpinfo it says it should be in C:/php5. THAT'S IT!!!!!!!!!!!

I know I can probably just make a php5 folder but I'd rather know where it is getting that direction and fix it. Any ideas there? By the way. THANKS!!!!

bradgrafelman
02-26-2008, 01:01 PM
What webserver are you running? The problem is that PHP isn't parsing the php.ini file at all.

If you're using Apache and have loaded PHP as an ISAPI module (e.g. using the .dll file), you need to add the PhpIniDir directive to Apache's httpd.conf file.

If you're using IIS, you need to add the PHPRC environment variable (or a registry key).