Solved

GD2 extension not working on PHP for Windows

Posted on 2011-09-06
32
783 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
  • 16
  • 13
  • 2
  • +1
32 Comments
 
LVL 108

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
 
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 34

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 34

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now