Jump to content

Recommended Posts

Hi all,

 

I want to use the gd library, but can't get it working properly.

 

when I try to run the samplecode from the imagechar page from the PHP-manual it works fine in my DEV-PHP IDE editor but in my browser it returns a fatal error (Fatal error: Call to undefined function imagecreate()).

 

The DEV-PHP IDE editor uses the php-cgi.exe as parser. My local Apache server uses the php.exe.

How come running the code thru php-cgi.exe works and thru php.exe doesn't? Aren't they both reading the same php.ini file located in the PHP root directory? ???

 

specs:

windows xp

apache 2.2

PHP 521 (as cgi)

 

Following de-commented in the php.ini file

extension=php_gd2.dll

 

Following added in the apache httpd.conf file:

PHPIniDir "C:/PHP5.2.1"

LoadModule php5_module "C:/PHP5.2.1/php5apache2_2.dll"

Link to comment
https://forums.phpfreaks.com/topic/42377-gd-library-works-only-with-php-cgiexe/
Share on other sites

Are you sure that your IDE does not use some version of php-cgi.exe shipped with it? That for instance how Zend Studio does it. Anyways, do you get any errors when using the Apache module version of PHP? Are there any errors in Windows' error log concerning this issue?

IDE editor _does_ use the correct php-cgi.exe.

I found an error in the Apache error log. The module couldn't be found:

PHP Warning:  PHP Startup: Unable to load dynamic library './ext/php_gd2.dll' - The specified module could not be found.\r\n in Unknown on line 0

 

So in the php.ini, I used the absolute path in the extension_dir directive:

extension_dir = "C:/PHP5.2.1/ext/"

 

It works. But strange that apache didn't understand the relative path in the php.ini file. Maybe I still have some incorrect apache settings.

Any ideas?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.