php 几个扩展(extension)的安装笔记

centos下安装php扩展时遇到的问题php

1.imapgit

cd /root/php-5.6.27/ext/imap /usr/local/php/bin/phpize ./configure --prefix=/usr/local/imap

错误1github

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.

解决方法centos

yum install libc-client-devel -y

错误2app

configure: error: Cannot find imap library (libc-client.a). Please check your c-client installation.

解决方法php-fpm

ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so

错误3ui

configure: error: This c-client library is built with Kerberos support. Add --with-kerberos to your configure line. Check config.log for details.

解决方法spa

./configure --prefix=/usr/local/imap --with-kerberos

错误4debug

configure: error: This c-client library is built with SSL support. Add --with-imap-ssl to your configure line. Check config.log for details.

解决方法rest

 ./configure --prefix=/usr/local/imap --with-kerberos --with-imap-ssl

make && make install


2.opcache

 

cd /root/php-5.6.27/ext/opcache /usr/local/php/bin/phpize ./configure --prefix=/usr/local/opcache make && make install 
echo "extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/opcache.so" >> /etc/php.ini service php-fpm restart

错误1

Gracefully shutting down php-fpm . done Starting php-fpm [15-Jan-2018 13:45:26] NOTICE: PHP message: PHP Warning:  PHP Startup: Invalid library (appears to be a Zend Extension, try loading using zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/opcache.so from php.ini) in Unknown on line 0
 done

解决方法

#把extension改为zend_extension echo "zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/opcache.so" >> /etc/php.ini

3.apcu
默认没有apcu的扩展包,须要额外下载
github地址
php 5.6版本,下载4.0.11版本的apcu
而后是正常安装

4.gd
首先安装:jpegsrc,freetype,libpng
tar xf jpegsrc.v9.tar.gz cd jpeg-9/ CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/jpeg make && make install
tar zxf freetype-2.7.1.tar.gz cd freetype-2.7.1 ./configure --prefix=/usr/local/freetype make && make install
tar zxf libpng-1.6.29.tar.gz cd libpng-1.6.29 CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/libpng make && make install

而后编译gd库

cd /root/php-5.6.27/ext/gd/
/usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/libpng --with-freetype-dir=/usr/local/freetype make && make install
复制最后显示的一行 /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
在/etc/php.ini最后一行添加
echo "extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/gd.so" >> /etc/php.ini

 


5.ldap
php-ldap模块做用就是实现ldap认证,所以须要安装openldap openldap-devel
yum install openldap yum install openldap-devel
拷贝库文件
cp -frp /usr/lib64/libldap* /usr/lib/
编译安装php-ldap模块
cd /usr/local/src/php-7.0.21/ext/ldap/  
/usr/local/php/bin/phpize          ./configure --with-php-config=/usr/local/php/bin/php-config make
make install

而后在php的php.ini的配置文件添加

echo "extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/ldap.so" >> /etc/php.ini
相关文章
相关标签/搜索