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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 06:01:29 2024 UTC