问题:

Fatal error: Call to undefined function Think\imagettftext() in /var/www/webreg/ThinkPHP/Library/Think/Verify.class.php on line 143

查看phpinfo()后得知,gd中没有freetype的支持

解决:

首先安装freestyle,php-gd

确保先安装freestyle,然后是php-gd;如果是先安装了php-gd,那么在安装完freestyle后,需要make clean(这句很重要,弄了很多此,,,在这)

然后重新配置编译参数如下:

1.到【你的php源码解压目录】/ext/gd

make clean
./configure 
--with-mysql 
--prefix=/homewww/php 
--with-apxs2=/homewww/httpd/bin/apxs 
--with-config-file-path=/homewww/php/conf 
--with-gd --enable-exif 
--enable-gd-native-ttf 
--enable-inline-optimization 
--with-zlib --with-png-dir 
--with-jpeg-dir=/usr/local/jpeg 
--with-freetype-dir=/usr/local/lib 
--with-ttf 
--enable-mbstring 
--with-gettext 
--enable-gd-jis-conv
make && make install
2. 成功后提示如下,
Installing shared extensions:     /homewww/php/lib/php/extensions/no-debug-zts-20100525/
这样新编译的gd.so会在此路径下,需要cp到你的php.ini中配置的extension_dir的目录下即可。
3.以apache为例,重启 apache,service httpd restart 
4.另外,也有可能是libjpeg libpng zlib这些引起,按提示安装后编译进去即可。  这些依赖库包括freetype ,php-gd可通过yum install方式安装



好久没记录东西了,希望能帮到后来遇到问题的朋友。。。




----------------附上完整php编译参数:------------------------------------------------------------------------------------------------------------------------------------------

./configure \
--prefix=/homewww/php \
--with-apxs2=/homewww/httpd/bin/apxs \
--with-config-file-path=/homewww/php/conf \
--with-mysql \
--with-mysqli \
--with-mysql-sock \
--enable-pdo \
--with-pdo-mysql \
--with-gd \
--with-iconv  \
--with-zlib \
--enable-xml \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--enable-mbregex \
--enable-mbstring \
--enable-gd-native-ttf \
--with-openssl \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--without-pear \
--with-gettext \
--enable-session \
--with-jpeg-dir=/usr/local/jpeg \
--with-freetype-dir \
--with-png-dir=/usr/local/pngp \
--with-bz2 \





更多相关文章

  1. 装完Centos7提示Initial setup of CentOS Linux 7 (core)
  2. 在fc8安装TP-Linux WN3210G+USB无线网卡,提示wlan0 No scan resul
  3. 在PreparedStatement中重用参数?
  4. LINUX下用SHELL脚本执行带输入输出参数的ORACLE存储过程并得到结
  5. C#中操作Oracle时的SQL语句参数的用法
  6. 存储过程放在sql脚本里,命令行导入总是提示错误
  7. Mysql5.7.10版本安装后空密码登录,退出后提示密码错误连接不上解
  8. 彻底理解初始化参数SERVICE_NAMES和客户端TNS中的SERVICE_NAME
  9. 项目连接MySQL数据库,提示异常

随机推荐

  1. Android 基于注解IOC组件化/模块化的架构
  2. android中AVD的使用
  3. Android实践手册:该如何应用Android知识到
  4. Ubuntu14.04下最新Android(安卓)NDK安装
  5. Android(安卓)中 Bitmap 和 Drawable 相
  6. 安卓开发一步到位
  7. 读取Android联系人列表
  8. 独立android开发者开发app如何盈利
  9. android安卓手机分屏多窗口实现方法
  10. android 反编译工具