MrCalapo Posted August 24, 2010 Share Posted August 24, 2010 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! Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 24, 2010 Share Posted August 24, 2010 What does a phpinfo(); statement show for the Loaded Configuration File? That is the php.ini that is being used by php. Quote Link to comment Share on other sites More sharing options...
MrCalapo Posted August 24, 2010 Author Share Posted August 24, 2010 Thanks for the quick reply. I've had a look at the PHPinfo file and it says (none) for the loaded configuration file. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 24, 2010 Share Posted August 24, 2010 You need a PHPIniDir statement in your httpd.conf file, something like - PHPIniDir "C:/php" Quote Link to comment Share on other sites More sharing options...
MrCalapo Posted August 24, 2010 Author Share Posted August 24, 2010 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. Quote Link to comment Share on other sites More sharing options...
MrCalapo Posted August 24, 2010 Author Share Posted August 24, 2010 Here's a screenshot of the phpinfo if it helps [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 24, 2010 Share Posted August 24, 2010 Have you restarted the web server to get the changes made to the php.ini to take effect? Quote Link to comment Share on other sites More sharing options...
MrCalapo Posted August 25, 2010 Author Share Posted August 25, 2010 Have you restarted the web server to get the changes made to the php.ini to take effect? Yes, I've tried that but to no success unfortunately. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 25, 2010 Share Posted August 25, 2010 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? Quote Link to comment Share on other sites More sharing options...
MrCalapo Posted August 26, 2010 Author Share Posted August 26, 2010 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. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 26, 2010 Share Posted August 26, 2010 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.