LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 997|回复: 4

快要崩溃了,大侠支招:关于Php GD使用freetype.

[复制链接]
发表于 2005-9-7 10:23:54 | 显示全部楼层 |阅读模式
相关信息

uname -r :  2.6.10-gentoo-r6

USE="X -qt -kde gtk2 php mysql real -gnome cjk divx4linux alsa mmx 3dnow unicode iconv lirc imap gd gd-external jpeg png gif apache2 truetype"

如果index.php为:
<?php  phpinfo();  ?>
返回:

Build Date         Sep 7 2005 09:49:16
Configure Command         './configure' '--prefix=/usr' '--host=i386-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--build=i386-pc-linux-gnu' '--with-apxs2=/usr/sbin/apxs2' '--disable-cli' '--without-pear' '--enable-gd-imgstrttf' '--with-ndbm=/usr' '--with-db4=/usr' '--with-mcrypt=/usr' '--with-mhash=/usr' '--without-interbase' '--without-ming' '--without-swf' '--without-sybase' '--with-gdbm=/usr' '--without-fdftk' '--without-java' '--without-mcal' '--without-unixODBC' '--without-pgsql' '--without-snmp' '--with-xpm-dir=/usr/X11R6' '--without-gmp' '--without-mssql' '--without-crack' '--without-pdflib' '--with-gd=/usr' '--enable-gd-native-ttf' '--with-png=/usr' '--with-png-dir=/usr' '--with-jpeg=/usr' '--with-jpeg-dir=/usr' '--enable-exif' '--with-tiff=/usr' '--with-tiff-dir=/usr' '--with-mysql=/usr' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-freetype-dir=/usr' '--with-ttf=/usr' '--with-t1lib=/usr' '--with-gettext' '--with-pspell=/usr' '--with-openssl=/usr' '--with-imap=/usr' '--with-ldap=/usr' '--with-dom=/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--without-kerberos' '--with-pam' '--disable-memory-limit' '--enable-ipv6' '--without-yaz' '--disable-debug' '--with-curlwrappers' '--with-curl=/usr' '--enable-dbx' '--with-imap-ssl' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--with-sablot=/usr' '--enable-xslt' '--with-xslt-sablot' '--with-xmlrpc' '--enable-wddx' '--with-xml' '--enable-mbstring=all' '--enable-mbregex' '--with-bz2=/usr' '--with-cdb' '--enable-pcntl' '--enable-bcmath' '--enable-calendar' '--enable-dbase' '--enable-filepro' '--enable-ftp' '--with-mime-magic=/usr/share/misc/file/magic.mime' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-iconv' '--enable-shmop' '--enable-dio' '--enable-yp' '--without-ncurses' '--without-readline' '--enable-inline-optimization' '--enable-track-vars' '--enable-trans-sid' '--enable-versioning' '--with-config-file-path=/etc/php/apache2-php4' '--libdir=/usr/lib/php' '--without-pear'
Server API         Apache 2.0 Handler
Virtual Directory Support         disabled
Configuration File (php.ini) Path         /etc/php/apache2-php4/php.ini
PHP API         20020918
PHP Extension         20020429
Zend Extension         20050606
Debug Build         no
Zend Memory Manager         enabled
Thread Safety         disabled
Registered PHP Streams         php, http, ftp, https, ftps, compress.bzip2, compress.zlib

如果index.php为:

<?php

// Change this defines to where Your fonts are stored
DEFINE("TTF_DIR","/usr/X11R6/lib/X11/fonts/truetype/");
// Change this define to a font file that You know that You have
DEFINE("TTF_FONTFILE","VeraSe.ttf");
// Text to display
DEFINE("TTF_TEXT","Hello World!");

$im = imagecreatetruecolor (400, 100);
$white = imagecolorallocate ($im, 255, 255, 255);
$black = imagecolorallocate ($im, 0, 0, 0);

imagefilledrectangle($im,0,0,399,99,$white);
imagettftext ($im, 30, 0, 10, 40, $black, TTF_DIR.TTF_FONTFILE,TTF_TEXT);

header ("Content-type: image/png");
imagepng ($im);

?>

返回值:

64 - Host not available
Internet Security and Acceleration Server

求救,为什么不能使用imagettftext .
发表于 2005-9-7 11:13:17 | 显示全部楼层
保护模式下你还敢读系统的ttf字体,讨打!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-7 11:18:42 | 显示全部楼层
没看出来哪里是保护模式呀?

从php -m的情况来看,确实没有加在freetype模块,可是编译的时候明明指定了为什么呢?

[PHP Modules]
bcmath
bz2
calendar
ctype
curl
dba
dbase
dbx
dio
domxml
exif
filepro
ftp
gd
gettext
iconv
imap
ldap
mbstring
mcrypt
mhash
mime_magic
mysql
ncurses
openssl
overload
pcntl
pcre
posix
pspell
readline
session
shmop
sockets
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlrpc
xslt
yp
zlib

[Zend Modules]
回复 支持 反对

使用道具 举报

发表于 2005-9-8 15:07:15 | 显示全部楼层
依赖freetype库,服务器是不是没装这个,还要像X字体美化那样配置
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-11 08:24:12 | 显示全部楼层
已经搞定,重新emerge freetype 然后emerge mod_php就搞定了,最后的php -m里面还是没有freetype,但是生成图片已经没有问题了,可能freetype只是作为gd的一个依赖,并不是Mod_php单独的一个Module吧.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表