GD2 extension not working on PHP for Windows

Hi,

I am used to ASP, rather than PHP, so I am not experinced in PHP.

I am trying to migrate a PHP site from a Linux server to my Windows Server. Most of the site is working, but I am getting the following error:

PHP Fatal error: Call to undefined function imagecreatetruecolor() in D:\InetPub\Hiltfields\www\hfadmin\thumbnailer.php on line 27

I have confirmed that my php.ini contains:

extension_dir ="C:\PHP5\ext"

and

[PHP_GD]
extension=php_gd2.dll

I have also confirmed that there is a file called php_gd2.dll in C:\PHP5\ext

I don't know if this is relevant, but I tried to regsvr32 on php_gd2.dll and I get:

LoadLibrary("C:\PHP5\ext\php_gd2.dll") failed - The specified module could not be found.


What else do I need to do.

Richard
LVL 1
rpmAsked:
Who is Participating?
 
rpmConnect With a Mentor Author Commented:
This problem was solved by a server consultant. I do not know what he did to fix it!
0
 
Ray PaseurCommented:
0
 
leakim971PluritechnicianCommented:
just a tip, create a php script with this inside :
<?PHP
phpinfo();
?>

Open in new window


You will get usefull informations about your config.

Could you confirm you really have php_gd2.dll at the right place? I mean inside C:\PHP5\ext\
With the previous script, confirm the path of your extension folder

else you may use the php installer to update your config (choose the rigth version) and (re)install GD2
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
rpmAuthor Commented:
leakim971:

I have created such as page at:

http://test.hiltfields.co.uk/hfadmin/gdv.php

Does this give you any clues?
0
 
rpmAuthor Commented:
Ray_Paseur:

I have read the documents you linked, and I'm afriad they give me no clue as to where to go next.

Richard
0
 
leakim971PluritechnicianCommented:
we can clearly see than GD2 is not installed
the extension is : C:\PHP5\ext

did you check inside to confirm presence of the dll?

else you may use the php installer to update your config (choose the rigth version) and (re)install GD2
0
 
rpmAuthor Commented:
Ok, I ran the PHP installer, and you were right, GD2 was not installed. I added this in and completed the installer, but the error is unchanged.

Any ideas?
0
 
leakim971PluritechnicianCommented:
restart apache and if possible your OS.
0
 
gr8gonzoConsultantCommented:
Also, always check permissions. A quick way to see if it's a permissions problem is to make a copy (for backup) of your C:\PHP5 folder (call it C:\PHP5Original). Then edit C:\PHP5, replace all existing permission entries with a single entry for "Everyone" to have all permissions, and make sure you choose to replace all the permissions on child objects of C:\PHP5. That way, everything inside C:\PHP5 should be globally accessible.

If that doesn't fix the problem, then it's something else aside from permissions. If it DOES fix the problem, then you're probably running Apache (or whatever is invoking PHP) as a user that does not have permissions to the directories and/or DLL files.
0
 
rpmAuthor Commented:
I have restarted ths OS, and no difference!
0
 
rpmAuthor Commented:
Tried the "everyone" trick, still no difference!
0
 
leakim971PluritechnicianCommented:
check the window application event logs  you should find an error
0
 
rpmAuthor Commented:
There is a lot of the following error ... don't know if this is relevant or not!

Windows cannot query DllName registry entry for {CF7639F3-ABA2-41DB-97F2-81E2C5DBFC5D} and it will not be loaded. This is most likely caused by a faulty registration.
0
 
leakim971PluritechnicianCommented:
you confirm the dll is in the folder? (C:\PHP5\ext)
0
 
rpmAuthor Commented:
Yes, it is!
0
 
leakim971PluritechnicianCommented:
Could you reinstall PHP5 after removing it? Reboot just after uninstalling
confirm your OS/IIS version please

0
 
rpmAuthor Commented:
Windows 2003 / IIS6

I will try a reinstall of PHP5 later this evening!
0
 
gr8gonzoConsultantCommented:
Try using the ZIP files instead of the installer and doing a manual install per the documentation.
0
 
leakim971PluritechnicianCommented:
>Try using the ZIP files instead of the installer and doing a manual install per the documentation

On windows+IIS I prefer to use the installer.
0
 
rpmAuthor Commented:
Ok, now uninstalled and reinstalled PHP.

Now I get:

FastCGI Error
 The FastCGI Handler was unable to process the request.
--------------------------------------------------------------------------------

Error Details:
•The FastCGI executable could not be found
 •Error Number: 2 (0x80070002).
•Error Description: The system cannot find the file specified.

HTTP Error 500 - Server Error.
Internet Information Services (IIS)
0
 
rpmAuthor Commented:
Ignore my previous post, I've solved that one myself!
0
 
rpmAuthor Commented:
Ultimatly it proved no different, still no GD2.

Any more ideas before I admit defeat and turn down the hosting job?
0
 
leakim971PluritechnicianCommented:
can you just put the phpinfo in place in gdv.php
0
 
leakim971PluritechnicianCommented:
copy php_gd2.dll in c:\windows\system32 folder
0
 
rpmAuthor Commented:
No difference!
0
 
leakim971PluritechnicianCommented:
did you restart?
0
 
leakim971PluritechnicianCommented:
the OS?
0
 
rpmAuthor Commented:
Yes
0
 
leakim971PluritechnicianCommented:
but you did not update gdv.php, please just let phpinfo
0
 
leakim971PluritechnicianCommented:
http://www.php.net/manual/en/install.windows.installer.php

This installs the CGI version of PHP and for IIS

Error Details:
•The FastCGI executable could not be found
 •Error Number: 2 (0x80070002).
•Error Description: The system cannot find the file specified.

????
0
 
rpmAuthor Commented:
gdv.php is now back to displaying phpinfo
0
 
rpmAuthor Commented:
See comment above!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.