PHP 7 编译问题集

发表于:2016-04-06 18:41:01,已有2874次阅读

编译PHP make 时出现错误

make: *** \[ext/fileinfo/libmagic/apprentice.lo\] Error 1

解决办法:

这是由于内存小于1G所导致.

在./configure加上选项:

--disable-fileinfo

链接:
http://nbaiwan.blog.51cto.com/6286161/1425200

其它:

CentOS 6 在编译安装PHP mcrypt库:libmcrypt-devel时,提示找不到libmcrypt-devel包:

可以添加RPM包源:

rpm -ivh "http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm"

rpm -ivh "http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm"

然后再执行yum install libmcrypt-devel


链接:
https://ma.ttias.be/rhel-6-and-centos-6-missing-libmcrypt-and-libmhash-in-default-repository/
http://blog.path8.net/archives/6024.html

Updating CMake from 2.8.11 to 3.6.2 or Newer Version on CentOS Linux

On CentOS 7, using yum install gives you cmake version 2.8.11

[root@thrift1 ~]# cat /etc/*release
CentOS Linux release 7.2.1511 (Core)

[root@thrift1 ~]# yum info cmake
Installed Packages
Name        : cmake
Arch        : x86_64
Version     : 2.8.11

In order to install version 3.6.2 or newer version, first uninstall it with yum remove:

[root@thrift1 ~]# sudo yum remove cmake -y

If you don't perform the above step to remove old CMake version, you may see below error after the final step that you installed the newer CMake version.

CMake has most likely not been installed correctly

Download, extrace, compile and install the code cmake-3.6.2.tar.gz from https://cmake.org/download/

[root@thrift1 testdelete]# wget https://cmake.org/files/v3.6/cmake-3.6.2.tar.gz
[root@thrift1 testdelete]# tar -zxvf cmake-3.6.2.tar.gz
[root@thrift1 testdelete]# cd cmake-3.6.2
[root@thrift1 cmake-3.6.2]# sudo ./bootstrap --prefix=/usr/local
[root@thrift1 cmake-3.6.2]# sudo make
[root@thrift1 cmake-3.6.2]# sudo make install
[root@thrift1 cmake-3.6.2]# vi ~/.bash_profile
PATH=/usr/local/bin:$PATH:$HOME/bin
[root@thrift1 ~]# cmake --version
cmake version 3.6.2

Install libzip 1.5+

wget https://libzip.org/download/libzip-1.5.0.tar.gz
tar -zxvf libzip-*
cd libzip*
mkdir build && cd build && cmake .. && make && make install

off_t undefined; check your library configuration

编译PHP时出现的提示,报错信息为: configure: error: off_t undefined; check your library configuration 。这个一般在64位系统出现。
解决方案:

echo '/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'>>/etc/ld.so.conf&&ldconfig -v

ldconfig是一个动态链接库管理命令,其目的为了让动态链接库为系统所共享。
ldconfig的主要用途:
默认搜寻/lib和/usr/lib,以及配置文件/etc/ld.so.conf内所列的目录下的库文件。

Links

  1. http://jotmynotes.blogspot.com/2016/10/updating-cmake-from-2811-to-362-or.html
  2. https://blog.csdn.net/oxiaobaio/article/details/80854054

PHP 7编译安装:

  1. https://segmentfault.com/a/1190000004123048

  2. https://www.zybuluo.com/gabe/note/241786

评论

暂无评论

您还可输入120个字