Search code examples
iis-7.5phpphp-gd

PHP GD Extension is not loaded on IIS 7.5


PHP GD Extension is loaded and working on local server but it is not loaded correctly on our live server even though I am using all the exact same files.

(PHP GD is working fine here) Local Server: Microsoft Windows Server 2003 For Small Business Server SP2 IIS Version: 6

Then I copied the whole "C:\PHP" folder from local server to "C:\Program Files (x86)\" on live server. That "PHP" folder does include ext folder and "php_gd2.dll" file inside it. I changed the path from "C:\PHP" to "C:\Program Files (x86)\" in "php.ini" too. However, PHP is not loaded on live server.

PHPINFO Local:http://jsfiddle.net/hFKfx/
PHPINFO Live: http://jsfiddle.net/h77Hy/

I am not very good with PHP. Please help.


Solution

  • In Win2K3 / IIS6, you're running PHP as a ISAPI module (thread-safe).
    In Win 7 / IIS7.5, you're running PHP as a FCGI module (non-thread-safe).

    This is likely your problem. You can't mix and match thread-safe (TS) / non-thread-safe (NTS) extensions with core PHP. If you just copied everything over, you probably have TS extensions. You need to download and use the NTS ones.

    (archive link to PHP 5.2.6 NTS)

    To verify this assumption, check where php.ini specifies a log for startup errors. If you're logging startup errors, you should see something similar to:

    PHP Warning: PHP Startup: gd Extension: Unable to initialize module
    Module compiled with build ID=API20041225,TS,VC6
    PHP compiled with build ID=API20041225,NTS,VC6
    These options need to match

    (note "TS" vs "NTS")

    Hope that helps. If not, maybe you'll find something else in the log that indicates what the problem is.