View Full Version : Problem with installing GD on windows
matak
05-18-2007, 07:43 PM
I hope you can help me with this one. I'm running apache 2 and PHP Version 5.2.1RC4-dev on my localhost. I tried to install GD to it, and i found that for windows all i have to do is uncomment extension=php_gd2.dll, and by runing this script <?php print_r(gd_info()); ?> i should get GD info.
When runing it i get
Fatal error: Call to undefined function gd_info() in ...\www\Apache2\htdocs\fasttest.php on line 1
What can be the problem? GD is obviusly not installed couse when i run php info it's not shown anywhere
aedrin
05-18-2007, 07:53 PM
Make a page and put in this:
<?php
phpinfo();
?>
Does it mention that GD is loaded? If not, then something is wrong. Check your Apache logs for any PHP errors.
matak
05-18-2007, 08:08 PM
with phpinfo when i search for GD i only get it here
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"
when i run
<?php print_r(gd_info()); ?>
i don't get any errors in apache2/log/errors.log
but php shows error from 1st post
and when i test this
<?php
header("Content-type: image/png");
$string = $_GET['text'];
$im = imagecreatefrompng("images/button1.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);
?>
i get this error on website
The image “http://localhost:8080/fasttest.php” cannot be displayed, because it contains errors.
And no errors in Apache error.log log
Any ideas what could be wrong?
my php_gd2 size is 928 KB (950.329 bytes), and size on disk 932 KB (954.368 bytes)
aedrin
05-18-2007, 08:23 PM
If it doesn't show up in phpinfo() (it should have its own section like other extensions) then it's not being loaded properly. Did you check all Apache logs?
You can try starting Apache on a command line, it should show you all the output and any PHP errors if they exist.
matak
05-18-2007, 08:34 PM
How do you mean run from comand line. You mean by placing myself in command prompt apache/bin folder and running apache.exe? When i do that i only see downslash, and my apache works.
Here's the Catch, if it's a catch. Long time ago i installed and configured Apache and PHP on my Windows. Now when i reinstall windows on my C partition i don't install apache and php again. Couse both of them are configured on D partition, and work fine.
Do i need to run enviromental variables for PHP in windows in order for GD to work? (Just trying that solution, so after restart i'm back :) )
aedrin
05-18-2007, 08:36 PM
I don't think you need to have anything externally set. If your httpd.conf and php.ini are correct it should work.
That said, I have no experience with GD so that might require additional settings.
Yes, you would run it like that. Try running PHP seperately from the command line.
matak
05-18-2007, 08:44 PM
I added in Enviromental variables, System Variables, PATH - path to my PHP directory, and with
var_dump(gd_info()); i get this
array(12) { ["GD Version"]=> string(27) "bundled (2.0.28 compatible)" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "with freetype" ["T1Lib Support"]=> bool(true) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XPM Support"]=> bool(false) ["XBM Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) }
Also, i can se the GD extension in phpinfo(); now.
Maybe if someone knows how to configure apache httpd.conf so that i don't need to add PHP enviromental variable to windows and that it loads PHP anyway, it would be great.
Thanks for you help aedrin!
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.