php gd freestyle,linux重新编译安装gd,增加freetype支持,解决验证码不显示问题,Fatal error: Call to undefined function image...

问题:

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方式安装

e689a5152e5208f2520799451f121b9c.png

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

----------------附上完整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 \

版权声明:本文为博主原创文章,未经博主允许不得转载。

原文:http://blog.csdn.net/hxl5u/article/details/47629649

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据引用所提供的信息,当编译hello world程序时,出现了"main.c:3:10: fatal error: test.h: No such file or directory"的错误。这个错误表明编译器无法找到"test.h"头文件。 为了解决这个问题,你可以按照引用所给出的方法,通过设置环境变量来告诉编译器头文件的位置。 你可以使用以下命令设置C_INCLUDE_PATH和CPLUS_INCLUDE_PATH环境变量: ``` export C_INCLUDE_PATH=[你的头文件的位置] export CPLUS_INCLUDE_PATH=[你的头文件的位置] ``` 将"[你的头文件的位置]"替换为实际的test.h头文件所在的路径。然后重新编译你的程序,应该就能成功找到test.h头文件并解决这个错误了。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [fatal error: stdio.h: No such file or directory](https://blog.csdn.net/BenRenYiGuaShi/article/details/116646720)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [linux全志R16的linux系统编译的资料_20170502_1655.7z](https://download.csdn.net/download/wb4916/9831266)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [编译错误 freetype.c:14:10: fatal error: ft2build.h: No such file or directory](https://blog.csdn.net/qq_54508596/article/details/125639989)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值