PHP with GD + TTF fonts problem
Hi,
I have compiled the 'gd.so' module successfully using the osx.topicdesk.com tutorial, except 2 changes. I had to edit /usr/X11/lib/libpng.la and change '26' to '24' as described here:
http://sarth.thallos.org/search/label/libtool
And I also had to add '--with-gd=shared' to the 'configure' line.
Basic GD functionality is now working fine with the standard Apple installed PHP 5.2.6, but if I run the following PHP script, I see the following repeated many times in the error_log:
The script:
--------------------------
$width = 100;
$height = 100;
$filePNG = 'image.png';
$font_size = '29';
$font = 'monofont.ttf';
$code = 'test';
//first box
$im = ImageCreateTrueColor($width, $height);
$red = ImageColorAllocate($im, 255, 0, 0);
ImageFillToBorder($im, 0, 0, $red, $red);
imagepng($im,$filePNG);
ImageDestroy($im);
$textbox = imagettfbbox($font_size, 0, $font, $code) or die('Error in imagettfbbox function');
--------------------------
error_log
--------------------------------------------------------
[Thu Aug 14 16:22:53 2008] [notice] Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7l PHP/5.2.6 configured -- resuming normal operations
THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YO U_MUST_EXEC_() to debug.
The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on _THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___Y OU_MUST_EXEC_() to debug.
..
.
.. same thing repeats many times
--------------------------------------------------------
Any ideas on why this would happen? If I remove the last line (the imagettfbbox call), it works fine. It seems I am missing something to do with truetype or freetype? But phpinfo() says that everything is enabled and FreeType support is enabled, Freetype Linkage is "with freetype", and Freetype Version is 2.3.5.
I have compiled the 'gd.so' module successfully using the osx.topicdesk.com tutorial, except 2 changes. I had to edit /usr/X11/lib/libpng.la and change '26' to '24' as described here:
http://sarth.thallos.org/search/label/libtool
And I also had to add '--with-gd=shared' to the 'configure' line.
Basic GD functionality is now working fine with the standard Apple installed PHP 5.2.6, but if I run the following PHP script, I see the following repeated many times in the error_log:
The script:
--------------------------
$width = 100;
$height = 100;
$filePNG = 'image.png';
$font_size = '29';
$font = 'monofont.ttf';
$code = 'test';
//first box
$im = ImageCreateTrueColor($width, $height);
$red = ImageColorAllocate($im, 255, 0, 0);
ImageFillToBorder($im, 0, 0, $red, $red);
imagepng($im,$filePNG);
ImageDestroy($im);
$textbox = imagettfbbox($font_size, 0, $font, $code) or die('Error in imagettfbbox function');
--------------------------
error_log
--------------------------------------------------------
[Thu Aug 14 16:22:53 2008] [notice] Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7l PHP/5.2.6 configured -- resuming normal operations
THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YO U_MUST_EXEC_() to debug.
The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on _THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___Y OU_MUST_EXEC_() to debug.
..
.
.. same thing repeats many times
--------------------------------------------------------
Any ideas on why this would happen? If I remove the last line (the imagettfbbox call), it works fine. It seems I am missing something to do with truetype or freetype? But phpinfo() says that everything is enabled and FreeType support is enabled, Freetype Linkage is "with freetype", and Freetype Version is 2.3.5.
Intel Xeon XServe, Mac OS X (10.5.4)