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
相關文章
相關標籤/搜索