PHP 4.0 Bug #5220: Can't initialize download.swwwing.com's php_gd.dll
| From: | raganwald at yahoo dot com | Date: | Sun, 25 Jun 2000 03:50:24 +0000 |
| Subject: | PHP 4.0 Bug #5220: Can't initialize download.swwwing.com's php_gd.dll | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-22257@lists.php.net to get a copy of this message | ||
From: raganwald@yahoo.com
Operating system: WIndows NT 4.0 SP 5
PHP version: 4.0 Release Candidate 2
PHP Bug Type: Dynamic loading related
Bug description: Can't initialize download.swwwing.com's php_gd.dll
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 initializing the GD library. A dll conflict? Any
ideas?
Thanks VERY much in advance!