1 >CentOS6.5上 编译安装完成php运行php文件时产生下面的问题:
Fatal error: Call to undefined function imagettftext()
解决方案:
1> 首先查看phpinfo(),查找是否安装了gd扩展。如何没有重新编译安装。
2> 如何安装了gd扩展。查看是否为其添加了freetype,类似下面的项。
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.3.5
如果没有,请重新编译安装。
3> 如果编译安装后仍然没有解决问题先下载安装freetype。然后再编译安装php,可以参考以下配置。
./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-mysql=/usr --with-mysqli=/usr/bin/mysql_config --with-mysql-sock=/var/lib/mysql/mysql.sock --with-gd --enable-gd-native-ttf --with-jpeg-dir --with-png-dir --with-freetype-dir=/usr/local/freetype/ --enable-shared --enable-static --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-pear --with-gettext --enable-session --with-curl --with-apxs2=/usr/local/apache2/bin/apxs
注意修改相关路径。
4> 注意事项
编译php过程中,如果出现
configure: error: Cannot find libmysqlclient under /usr 类型信息。
1)请检查你配置php时的mysql路径(--with-mysql=xxxx)。
2) 如果你使用的是64位系统,可能需要执行以下操作
ln -s /usr/lib64/mysql/libmysqlclient.so /usr/lib/libmysqlclient.so
ln -s /usr/lib64/mysql/libmysqlclient_r.so /usr/lib/libmysqlclient_r.so