PHP编译安装之常见问题

  正式服的PHP环境,一般都会进行编译安装,汇总一下经常遇到的一些问题

1.Call to undefined function crmebutilsimagecreate

解决:需要安装gd库

1)进入到源码包ext目录下的gd下
2) phpize(提示如果找不到, 则需要安装autoconf   yum install -y autoconf)
3)   ./configure --with-php-config=/usr/local/php7/bin/php-config --with-gd
4)   make && make install
5)   php.ini 文件中添加 extensions=gd.so

2.Call to undefined function crmebutilsimagettftext

解决:需要安装freetype

1)wget wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.0.tar.bz2
2) tar -jxf freetype-2.4.0.tar.bz2
3)cd freetype-2.4.0
4)./configure --prefix=/usr/local/freetype
5) make && make install
6) 来到gd源码包的目录下,重新编译  phpize
7)./configure --with-php-config=/usr/local/php7/bin/php-config --with-freetype-dir=/usr/local/freetype/
8)make  && make install  
9)重启php-fpm  /etc/init.d/php-fpm restart 

原文地址:https://www.cnblogs.com/xingxia/p/php_install_problems.html