GD, PHP4, and Win32
| From: | Reginald Braithwaite-Lee | Date: | Sun, 25 Jun 2000 03:44:24 +0000 |
| Subject: | GD, PHP4, and Win32 | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-638@lists.php.net to get a copy of this message | ||
Hello, and thanks in advance for your help.
I want to do some JPEG manipulation with PHP on Win32. Actually, I need
to do JPEG manipulation and I'm trying to convince my colleagues we can
use PHP instead of Java. Helping with this can help advance the PHP
cause!!!
I installed PHP4 in D:/Devt/PHP/PHP4, and Apache in C:/Program
Files/Apache Group/Apache/...
My Apache httpd.conf file includes:
AddType application/x-httpd-php4 .php
Action application/x-httpd-php4 "/php4/php.exe"
ScriptAlias /php4/ "D:/devt/php/php4/"
And my php.ini file is in in C:/Winnt.
I tried scarfing php_gd.dll , php_zlib.dll, and zlib.dll from
download.swwwing.com. I placed these in D:/Devt/php/php4. Whenever I
'uncomment' php_gd.dll in the php.ini file (to load the dll
automatically), I get two problems
First, the header information leaks into the HTML, regardless of
whether I am calling a GD function or not. For example:
<HTML>
<SCRIPT LANGUAGE="PHP">
echo ("Hello ")
</SCRIPT>
<?php
echo ("World")
?>
</HTML>
Generates:
X-Powered-By: PHP/4.0.1-dev
Content-type: text/html
<HTML>
Hello World</HTML>
I gather this is a known problem with 4.0.x.
Second, the functions I try to call in GD are not available. For
example:
<?php
$im = ImageCreate (150, 30);
$bgc = ImageColorAllocate ($im, 255, 255, 255);
$tc = ImageColorAllocate ($im, 0, 0, 0);
ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc);
ImageString ($im, 1, 5, 5, "My Message", $tc);
Header("Content-Type: image/jpeg");
ImageJPEG($im);
ImageDestroy($im);
?>
Generates:
X-Powered-By: PHP/4.0.1-dev Content-type: text/html
Fatal error: Call to undefined function: imagecreate() in c:\program
files\apache group\apache\htdocs\test\autoload.php on line 3
I tried manually loading the GD library:
<?php
echo( dl("php_gd.dll") );
$im = ImageCreate (150, 30);
$bgc = ImageColorAllocate ($im, 255, 255, 255);
$tc = ImageColorAllocate ($im, 0, 0, 0);
ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc);
ImageString ($im, 1, 5, 5, "My Message", $tc);
Header("Content-Type: image/jpeg");
ImageJPEG($im);
ImageDestroy($im);
?>
Generates:
Warning: gd: Unable to initialize module Module compiled with debug=0,
thread-safety=1 module API=20000609 PHP compiled with debug=0,
thread-safety=0 module API=20000401 These options
need to match in Unknown on line 0
Fatal error: Call to undefined function: imagecreate() in c:\program
files\apache group\apache\htdocs\test\manualload.php on line 5
This seems to suggest that there is a problem initializingthe GD
library. A dll conflict? Any ideas?
Thanks VERY much in advance!
--
Reginald Braithwaite-Lee
__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/