linux又一次编译安装gd,添加freetype支持,解决验证码不显示问题,Fatal error: Call to undefined function imagettftext()
问题:
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方式安装
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
好久没记录东西了,希望能帮到后来遇到问题的朋友。。。
----------------附上完整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 \
linux又一次编译安装gd,添加freetype支持,解决验证码不显示问题,Fatal error: Call to undefined function imagettftext()的更多相关文章
- mac升级yosemite后安装gd的freetype扩展
Mac升级系统到 Yosemite 10.10,对于各位Coder来说,还是需要一些时间来折腾的! @星空之下 同学反映 PHPCMS 的验证码图片不能正常显示,反馈该验证码需要GD库支持FreeTy ...
- Linux下指定版本编译安装LAMP
说明: 操作系统:CentOS 6.5 64位 需求: 编译安装LAMP运行环境 各软件版本如下: MySQL:mysql-5.1.73 Apache:httpd-2.2.31 PHP:php-5.2 ...
- 烂泥:centos单独编译安装gd库
本文由秀依林枫提供友情赞助,首发于烂泥行天下. 这几天一直在弄一个商城系统,该系统的源码及数据库都已经上传并创建完毕.但是在安装该系统时,却提示缺少gd库.如下: 使用php探针查看,发现php确实没 ...
- 【转载】Linux升级NTPD服务器-编译安装ntp-4.2.8p12与配置
[转载]Linux升级NTPD服务器-编译安装ntp-4.2.8p12与配置 1. 系统与软件版本 1.1 系统版本 rhel6.4(Red Hat Enterprise Linux Server r ...
- Linux 从源码编译安装 OpenSSH
https://blog.csdn.net/bytxl/article/details/46639073 Linux 从源码编译安装 OpenSSH以及各问题解决 2015年06月25日 17:37: ...
- php5.6.30环境报错Call to undefined function ImageCreate() 编译安装 gd库
php5..30环境报错Call to undefined function ImageCreate() 编译安装 gd库 发现php5..30没有加载gd库 [root@cn_vs_web04:/u ...
- 在已经编译安装好php7场景下,install gd库 with free-type (解决Call to undefined function imagettftext())
在已经编译安装好php7场景下,install gd库 with free-type (解决Call to undefined function imagettftext()) install g ...
- PCL库在Linux环境下的编译安装
PCL库在Linux环境下的编译安装 PCL库的源码库:https://github.com/PointCloudLibrary/pcl 下载完了之后解压下来 编译库的几个步骤 mkdir build ...
- Linux中 cmake-3.x 编译安装以及man page添加
首先回顾一下 cmake-2.x 的编译安装. ================ cmake-2.x编译安装说明 ================编译安装的命令: ./bootstrap --pref ...
随机推荐
- 2015上海网络赛 HDU 5478 Can you find it 数学
HDU 5478 Can you find it 题意略. 思路:先求出n = 1 时候满足条件的(a,b), 最多只有20W对,然后对每一对进行循环节判断即可 #include <iostre ...
- 初学PHP&MySQL 2014-05-31 12:40 92人阅读 评论(0) 收藏
PHP echo print 都能输出文本 date(format,timestamp)可以格式化时间戳 mktime()可以返回指定日期的时间戳 include 'filename'或者 requ ...
- Announcing Zuul: Edge Service in the Cloud--转
原文地址:http://techblog.netflix.com/2013/06/announcing-zuul-edge-service-in-cloud.html The Netflix st ...
- FreeBSD是UNIX系统的重要分支,其命令与Linux大部分通用,少部分是其特有。
FreeBSD是UNIX系统的重要分支,其命令与Linux大部分通用,少部分是其特有. 1: man 在线查询 man ls2: ls 查看目录与档案 ls -la3: ln 建立链接文件 ln -f ...
- vim7.4官方源码在vs2013的编译方法及问题总结
vim7.4发布也有一段时候了,也该是把之前编译的7.3重新编译一下了,于是考虑着到最新的visual studio 2013编译一下,也顺便看看有没有其它问题. 1.安装vs2013,这个应该不用说 ...
- 【C/C++】链表的理解与使用
转载自:http://blog.csdn.NET/xubin341719/article/details/7091583/ 最近不是太忙,整理些东西,工作也许用得到. 1,为什么要用到链表 数组作为存 ...
- 00076_BigDecimal
1.在程序中执行下列代码,会出现什么问题? System.out.println(0.09 + 0.01); System.out.println(1.0 - 0.32); System.out.pr ...
- 4.2.2 MINUS
4.2.2 MINUS正在更新内容,请稍后
- hdu1234 开门人和关门人 (等价转换)
开门人和关门人 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Su ...
- Android照片墙完整版,完美结合 内存方案 LruCache 和 硬盘方案 DiskLruCache
转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/34093441 在上一篇文章当中,我们学习了DiskLruCache的概念和基本用法 ...