频道栏目
首页 > 资讯 > 其他综合 > 正文

centos7安装php5.6.30可能遇到的问题总结

17-08-02        来源:[db:作者]  
收藏   我要投稿

1、依赖安装提示没有可用的包libmcrypt

configure: error: mcrypt.h not found. Please reinstall libmcrypt.

解决方法:安装 libmcrypt
下载地址:https://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download

tar -xzf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8

./configure

make && make install

2、找不到opcache库

configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no

解决方法:编辑/etc/ld.so.conf.d/local.conf添加以下语句/usr/local/lib
# vi /etc/ld.so.conf.d/local.conf
/usr/local/lib
# ldconfig //生效
再执行configure,编译通过

3、off_t未定义

checking size of off_t... 0
configure: error: off_t undefined; check your library configuration
解决方法:安装libzip库

# yum install libzip

4、apache没有libphp5.so依赖

源码编译安装php时没有指定--with-apxs2,需要重新安装php,指定--with-apxs2参数,如:--with-apxs2=/usr/local/apache2/bin/apxs,该参数的目的是生成libphp5.so,让apache支持php。

重新编译时会报错:undefined reference to `ts_resource_ex',解决方法:make clean,将之前编译的结果清除

编译完成会生成文件libphp5.so

[root@server modules]# pwd
/usr/local/apache2/modules
[root@server modules]# ls libphp5.so 
libphp5.so
[root@server modules]# 

最后附上编译命令:

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-apxs2=/usr/local/apache2/bin/apxs --enable-inline-optimization --disable-debug  --disable-rpath --enable-shared  --enable-opcache --enable-fpm  --with-mysql --with-mysqli  --with-pdo-mysql --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --with-bz2 --with-gd --with-freetype-dir   --with-jpeg-dir   --with-png-dir 
make && make install
相关TAG标签
上一篇:列出1~1000内的所有素数(Python)
下一篇:Tensorflow神经网络基础结构
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站