centos7(deepin)编译安装php7.1.11

来源:互联网 发布:8080端口如何开启 编辑:程序博客网 时间:2024/06/03 20:25

废话 不多说,直接上操作

sudo yum install gcc libxml2 libxml2-devel zlib zlib-devel \openssl openssl-devel libcurl-devel \gd libjpeg libjpeg-devel libpng libpng-devel./configure --prefix=/usr/local/php --enable-fpm \--enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd  \--with-openssl --with-curl \--with-gd --enable-gd-native-ttf  --enable-mbstringmakesudo make installsudo cp ./php.ini-development /usr/local/php/lib/php.inisudo mv /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.confsudo mv /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf

括号中的为方案,可以换用
deepin 安装过程类似
缺少的

sudo apt install libssl-dev libcurl4-openssl-dev libpng-dev

编译安装libxml2
出现
libxml.c:3909: error: ‘PyObject’ undeclared (first use in this function)
libxml.c:3909: error: ‘module’ undeclared (first use in this function)
libxml.c:3915: warning: implicit declaration of function ‘Py_InitModule’
libxml.c:3915: warning: nested extern declaration of ‘Py_InitModule’
libxml.c:3915: error: ‘libxmlMethods’ undeclared (first use in this function)
make[4]: * [libxml.lo] Error 1
需要安装

yum -y install python-devel./configure --prefix=/usr/local/php --enable-fpm --with-libxml-dir=/usr/local/libxml2//推荐加上openssl,curl等参数--with-openssl--with-curl--enable-mysqlnd --with-mysqli=mysqlnd
原创粉丝点击