centos安装扩展

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地址
https://github.com/krakjoe/apcu
php 5.6版本,下载4.0.11版本的apcu
https://codeload.github.com/krakjoe/apcu/tar.gz/v4.0.11
而后是正常安装
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

进入 SSH 后依次执行以下命令

1.yum install libtidy libtidy-devel -y

注:以下命令中的 72 为php版本 如需要安装在 php5.4 版把 72 改成 54 即可
2.cd /www/server/php/71/src/ext/tidy
3./www/server/php/71/bin/phpize
4…/configure --with-php-config=/www/server/php/71/bin/php-config
5.make && make install
6.echo “extension = tidy.so” >> /www/server/php/71/etc/php.ini
7.service php-fpm-71 restart

[转自宝塔论坛@河妖

  • 10
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值