Jump to content

Recommended Posts

Hello all,

 

I'm trying to load the extension php_gd2 so I can use the PHP image.  I'm using PHP 5.2.14 using the Apache server on Vindows vista.  However, when I try running a script that uses imagecreatetruecolor(), I get the following error message:

 

Fatal error: Call to undefined function imagecreatetruecolor() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\PHPBook\Chapter22\draw.php on line 13

 

My php.ini file is located under C:/php/php.ini. and the extensions are located under C:/php/ext.  So far I have removed the semi-colon from

 

;extension=php_gd2.dll

 

from the php.ini file but to no success.  I have set the php file such that:

 

doc_root = "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

 

and

 

extension_dir = "C:/php/ext"

 

I have tried copying the php_gd2.dll to the system32 folder in windows but that hasn'rt helped.  PHP works fine at the moment in Apache and I can write scripts.  I would ideally like to use the extensions though.

 

Any help would be greatly appreciated!  If you require any additional information, please don't hesitate to ask!

 

Thanks!

 

 

 

Oh, I forgot to add that I've added something like that to the apache httpd.conf file.  From the instructions I was given, I added the lines to the httpd file: 

 

LoadModule php5_module c:/php/php5apache2_2.dll

PHPIniDir "C:/php"

AddType application/x-httpd-php .php

 

So I've already added what you've suggested.

What method did you use to get and install php? The .msi installer or the .zip package and manually install it?

 

Does the gd extension show up in the phpinfo() output?

 

Is the php_gd2.dll actually in the ext folder?

 

Have you successfully installed any other php extensions?

I used the zip method to install php and php_gd2.dll is definitely in the extension folder. 

 

The gd extension doesn't show in the php-info file.  I've just checked and none of the extensions seem to be working for me.  The MySQL_connect() function is producing an undefined error.

Any chance that when you edited php.ini that it got saved as php.ini.txt?

 

The only thing that stands out in the information so far is that the loaded configuration file is none, which means that php is using all the default values.

 

Beyond that, problems like this are usually permission problems. You should check the web server error log and your Windows event log for any startup errors that would help pin down where the problem is.

 

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.