TTF and GD 1.6 and DSO?
| From: | Martin Koistinen | Date: | Tue, 14 Mar 2000 00:02:50 +0000 |
| Subject: | TTF and GD 1.6 and DSO? | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-12077@lists.php.net to get a copy of this message | ||
Hi,
I'm having some trouble with Apache 1.3.11 and PHP 3.0.15 with TTF support. I have several other servers (not using DSO) running with GD/TTF and haven't had trouble but this one is getting me. In this one, I have compiled php3 as a DSO. It works perfectly except for TTF-calls where it seg-faults. GD also seems to make PNGs fine. The php_info page properly indicates that I am using "GD 1.6 (with PNG support), with FreeType".
I went ahead and re-compiled apache since I had installed libttf after apache just in case. I am assuming though that since I am using php3 as a DSO, it shouldn't matter. Am I off-base here? cp My config is Linux Mandrake 2.2.14-15mdksecure #1 SMP on Intel with the latest stable version of TTF and GD.
My code (taken mostly from the annotated manual for simplicity):
<?
$font = "/usr/local/ttfonts/arial.ttf"; # this DOES exist and is known to be a valid font
Header("Content-type: image/png");
$im = imagecreate(400,30);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
ImageTTFText($im, 20, 0, 10, 20, $white, $font, "Testing... Omega: Ω"); # omitting this line makes it NOT seg-fault.
ImagePNG($im);
ImageDestroy($im);
?>
On a related note: I have tried the same config with PHP4 and strangly, it recognizes the libttf but doesn't enable it (or something):
Taken from the phpinfo() output:
./configure '--with-apxs=/usr/local/apache/bin/apxs' '--enable-versioning' '--with-mysql=/usr/local/mysql'
'--enable-track-vars' '--enable-trans-sid' '--with-gd' '--with-ttf' '--with-ldap=/usr/local/openldap' '--with-xml'
These are NOT in the same order I specified them so I figure it must be somewhat recognizing the --with-ttf flag. (I specified --with-ttf=/usr/local/lib which is where my libttf is)
Does anyone have any clues for me?
-- Martin