php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5220 Can't initialize download.swwwing.com's php_gd.dll
Submitted: 2000-06-25 05:50 UTC Modified: 2000-07-02 03:50 UTC
From: raganwald at yahoo dot com Assigned:
Status: Closed Package: Dynamic loading
PHP Version: 4.0 Release Candidate 2 OS: WIndows NT 4.0 SP 5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: raganwald at yahoo dot com
New email:
PHP Version: OS:

 

 [2000-06-25 05:50 UTC] raganwald at yahoo dot com
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!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-25 05:55 UTC] sterling at cvs dot php dot net
Do you have GD on your system?
 [2000-07-02 03:50 UTC] sterling at cvs dot php dot net
You need to install the gd library as well.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 17:01:33 2025 UTC