|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-06-19 05:07 UTC] rasmus at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 16:00:01 2025 UTC |
This code: <? Header( "Content-type: image/gif"); if(!isset($s)) $s=11; $size = imagettfbbox(10,0, "/usr/local/fonts/TIMES.TTF",$text); $dx = abs($size[2]-$size[0]); $dy = abs($size[5]-$size[3]); $xpad=9; $ypad=9; $im = imagecreate($dx+$xpad,$dy+$ypad); $blue = ImageColorAllocate($im, 0x2c,0x6D,0xAF); $black = ImageColorAllocate($im, 0,0,0); $white = ImageColorAllocate($im, 255,255,255); ImageRectangle($im,0,0,$dx+$xpad-1,$dy+$ypad-1,$black); ImageRectangle($im,0,0,$dx+$xpad,$dy+$ypad,$white); ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black, "/usr/local/fonts/TIMES.TTF", $text); ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $white, "/usr/local/fonts/TIMES.TTF", $text); ImageGif($im); ImageDestroy($im); ?> It apparently is this line: $size = imagettfbbox(10,0, "/usr/local/fonts/TIMES.TTF",$text); causes A segmentation fault in apache's error_log, and of course the image is not displayed on both php 3.0.7, and 3.0.9. the php.ini is blank do-conf: ./configure --with-apache=../apache_1.3.6 --with-gd --with-mysql --with-ldap=/usr/local --with-imap --with-zlib --enable-debug=no Apache Modules: Compiled-in modules: http_core.c mod_env.c mod_log_config.c mod_mime_magic.c mod_mime.c mod_negotiation.c mod_status.c mod_info.c mod_include.c mod_autoindex.c mod_dir.c mod_cgi.c mod_asis.c mod_imap.c mod_actions.c mod_speling.c mod_userdir.c mod_proxy.c mod_alias.c mod_rewrite.c mod_access.c mod_auth.c mod_auth_anon.c mod_auth_dbm.c mod_digest.c mod_cern_meta.c mod_expires.c mod_headers.c mod_usertrack.c mod_unique_id.c mod_setenvif.c mod_php3.c mod_auth_mysql.c