0
点赞
收藏
分享

微信扫一扫

PHP编译安装之常见问题

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

 

1.Call to undefined function crmeb\utils\imagecreate

解决:需要安装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 crmeb\utils\imagettftext

解决:需要安装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

 

 

举报

相关推荐

0 条评论