Solved

GD2 extension not working on PHP for Windows

Posted on 2011-09-06
32
804 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:rpm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 16
  • 13
  • 2
  • +1
32 Comments
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 36489844
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36489852
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
 
LVL 1

Author Comment

by:rpm
ID: 36489894
leakim971:

I have created such as page at:

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

Does this give you any clues?
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 1

Author Comment

by:rpm
ID: 36489915
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
 
LVL 82

Expert Comment

by:leakim971
ID: 36489931
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
 
LVL 1

Author Comment

by:rpm
ID: 36489997
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
 
LVL 82

Expert Comment

by:leakim971
ID: 36490015
restart apache and if possible your OS.
0
 
LVL 35

Expert Comment

by:gr8gonzo
ID: 36490155
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
 
LVL 1

Author Comment

by:rpm
ID: 36490195
I have restarted ths OS, and no difference!
0
 
LVL 1

Author Comment

by:rpm
ID: 36490208
Tried the "everyone" trick, still no difference!
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36490211
check the window application event logs  you should find an error
0
 
LVL 1

Author Comment

by:rpm
ID: 36490230
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
 
LVL 82

Expert Comment

by:leakim971
ID: 36490279
you confirm the dll is in the folder? (C:\PHP5\ext)
0
 
LVL 1

Author Comment

by:rpm
ID: 36490287
Yes, it is!
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36490436
Could you reinstall PHP5 after removing it? Reboot just after uninstalling
confirm your OS/IIS version please

0
 
LVL 1

Author Comment

by:rpm
ID: 36490454
Windows 2003 / IIS6

I will try a reinstall of PHP5 later this evening!
0
 
LVL 35

Expert Comment

by:gr8gonzo
ID: 36490490
Try using the ZIP files instead of the installer and doing a manual install per the documentation.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36490624
>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
 
LVL 1

Author Comment

by:rpm
ID: 36491831
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
 
LVL 1

Author Comment

by:rpm
ID: 36491877
Ignore my previous post, I've solved that one myself!
0
 
LVL 1

Author Comment

by:rpm
ID: 36491996
Ultimatly it proved no different, still no GD2.

Any more ideas before I admit defeat and turn down the hosting job?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36492023
can you just put the phpinfo in place in gdv.php
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36492050
copy php_gd2.dll in c:\windows\system32 folder
0
 
LVL 1

Author Comment

by:rpm
ID: 36492094
No difference!
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36492106
did you restart?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36492107
the OS?
0
 
LVL 1

Author Comment

by:rpm
ID: 36492112
Yes
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36492122
but you did not update gdv.php, please just let phpinfo
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36492214
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
 
LVL 1

Author Comment

by:rpm
ID: 36492215
gdv.php is now back to displaying phpinfo
0
 
LVL 1

Accepted Solution

by:
rpm earned 0 total points
ID: 37172410
This problem was solved by a server consultant. I do not know what he did to fix it!
0
 
LVL 1

Author Closing Comment

by:rpm
ID: 37194312
See comment above!
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question