0

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.

hakre
  • 193,403
  • 52
  • 435
  • 836
Jonas T
  • 2,989
  • 4
  • 32
  • 43
  • As it is an installation/migration question rather than programming, it may be more suitable for [serverfault.com](http://serverfault.com). – Wiseguy Jun 26 '12 at 02:10
  • Thanks for pointing it out. I wish I could move this question to that server. – Jonas T Jun 26 '12 at 02:26

1 Answers1

1

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.

Wiseguy
  • 20,522
  • 8
  • 65
  • 81
  • Sorry again for being so noob. I just downloaded that zip file and overwrote everything to PHP folder. Now it turns out "Loaded Configuration File (none)". I changed file name from "php.ini-recommended" to "php.ini". The configuration file isn't loaded too. :( Should I change "FCGI" module to "IsapiModule"? Thanks. – Jonas T Jun 26 '12 at 02:23
  • FCGI vs ISAPI isn't a simple configuration change; it's how PHP is set up in IIS. Did you ever find the PHP log to see if there were any startup errors? – Wiseguy Jun 26 '12 at 02:34
  • OMG. I messed up everything. Even, PHPMyAdmin isn't working now. It says "Cannot load mysql extension. Please check your PHP configuration. - Documentation". I cannot see any extension in phpinfo() now. I ran "php.exe" and it doesn't show any error. – Jonas T Jun 26 '12 at 03:07
  • Jesus! I got mysql back. I'd better stop playing around today and leave it until weekend. Thanks for everything Wiseguy. – Jonas T Jun 26 '12 at 03:26
  • WOW That's fantasitc. As soon as I fixed mysql extension, GD extension is also loaded automatically. Brovo Wiseguy. – Jonas T Jun 26 '12 at 03:28