[PHP] 编译构建最新版PHP源码

获取最新PHP代码
git clone https://git.php.net/repository/php-src.git
构建编译环境
apt-get install build-essential

编译:
./buildconf
报错autoconf not found,apt-get install autoconf
./configure --help
./configure --prefix=/tmp/ --disable-all //指定编译后的路径,关闭所有的扩展编译
报错configure: error: bison is required to build,==>apt-get install bison
报错configure: error: xml2-config not found.,==>apt-get install libxml2*


make
报错virtual memory exhausted: Cannot allocate memory,==>没有分配虚拟内存,swap
dd if=/dev/zero of=/swap bs=1024 count=1M
mkswap /swap
swapon /swap
echo "/swap swap swap sw 0 0" >> /etc/fstab

make install

posted @ 2018-01-13 19:47  唯一客服系统开发笔记  阅读(323)  评论(0编辑  收藏  举报