linux又一次编译安装gd,添加freetype支持,解决验证码不显示问题,Fatal error: Call to undefined function imagettftext()
2017-06-13 15:40
671 查看
问题:
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 \
相关文章推荐
- linux重新编译安装gd,增加freetype支持,解决验证码不显示问题,Fatal error: Call to undefined function imagettftext()
- gd 添加freetype支持 。Call to undefined function Think\imagettftext() 错误解决
- 解决 Fatal error: Call to undefined function imagettftext() 生成验证码错误
- 生成验证码时出现Fatal error: Call to undefined function imagettftext(),如何处理?
- 安装GD库解决ThinkPHP 验证码Call to undefined function Think\imagecreate()出错
- 生成验证码时出现Fatal error: Call to undefined function imagettftext()
- php连接mysql提示Call to undefined function mysql_connect() 或 ZenCart MySQL支持问题的解决
- thinkphp验证码显示不出来 Fatal error: Call to undefined function imagettftext() 生成验证码错误
- 开发新浪微博应用出现以下问题Fatal error:Call to undefined function curl_init() in错误的解决方法
- thinkPHP 运行出现Fatal error: Call to undefined function Think\imagettftext()...问题
- Fatal error: Call to undefined function imagettftext()解决办法
- phpMyAdmin出现Fatal error: Call to undefined function __() in ..../core.lib.php on line 229解决办法
- Fatal error: Call to undefined function imagettftext()
- Fatal error: Call to undefined function curl_init()解决方法
- 解决linux VPS安装weblogic时碰到的显示问题Checking monitor: must be configured to display at least 256 colors
- 如何解决Call to undefined function mysql_connect() 问题
- Fatal error: Call to undefined function mysql_connect() 解决办法
- Linux 编译报错 -- undefined reference to 问题解决方法 (具体'pthread_create'和opencv看文章最后两条)
- PHP FATAL ERROR: CALL TO UNDEFINED FUNCTION BCMUL()解决办法
- 出现Fatal error: Call to undefined function mysql_connect()错误的解决方法