php7在centos上源码安装
2016-05-20 15:36
706 查看
一 php7.0.6版本下载链接:
wget -c http://cn2.php.net/get/php-7.0.6.tar.gz/from/this/mirror
二 安装基础的依赖软件:
yum install -y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel \
libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel \
libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel \
ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 \
krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap \
openldap-clients openldap-servers php-mysqlnd libmcrypt-devel \
libtidy libtidy-devel recode recode-devel libxpm-devel
yum install -y autoconf
三 解压php压缩包:
tar zxvf php-7.0.6.tar.gz
编译:
./configure \
--prefix=/webser/php7 \
--with-config-file-path=/data/php7/etc \
--enable-mbstring \
--enable-zip \
--enable-bcmath \
--enable-pcntl \
--enable-ftp \
--enable-exif \
--enable-calendar \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-opcache \
--enable-fpm \
--enable-session \
--enable-sockets \
--enable-mbregex \
--with-fpm-user=vagrant \
--with-fpm-group=nogroup \
--enable-wddx \
--with-curl \
--with-mcrypt \
--with-iconv \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-freetype-dir=/usr \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-openssl \
--with-pdo-mysql=mysqlnd \
--with-gettext=/usr \
--with-zlib=/usr \
--with-bz2=/usr \
--with-recode=/usr \
--with-xmlrpc \
--with-mysqli=mysqlnd
make -j 4
make test
make install
copy相关文件:
进入php7解压的文件夹
cp -a php.ini-production /webser/php7/php.ini
cp sapi/fpm/init.d.php-fpm /etc/init.d/php7-fpm
chmod +x /etc/init.d/php7-fpm
cd /webser/php7
cp /webser/php7/etc/php-fpm.conf.default /webser/php7/etc/php-fpm.conf
cp /webser/php7/etc/php-fpm.d/www.conf.default //php7/etc/php-fpm.d/
www.conf
修改 www.conf文件:
修改以下字段即可:
user=www
group=www
listen = 127.0.0.1:9007 (默认为9000,以免和系统的php5.3版本冲突,所以起个其他端口)
wget -c http://cn2.php.net/get/php-7.0.6.tar.gz/from/this/mirror
二 安装基础的依赖软件:
yum install -y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel \
libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel \
libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel \
ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 \
krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap \
openldap-clients openldap-servers php-mysqlnd libmcrypt-devel \
libtidy libtidy-devel recode recode-devel libxpm-devel
yum install -y autoconf
三 解压php压缩包:
tar zxvf php-7.0.6.tar.gz
编译:
./configure \
--prefix=/webser/php7 \
--with-config-file-path=/data/php7/etc \
--enable-mbstring \
--enable-zip \
--enable-bcmath \
--enable-pcntl \
--enable-ftp \
--enable-exif \
--enable-calendar \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-opcache \
--enable-fpm \
--enable-session \
--enable-sockets \
--enable-mbregex \
--with-fpm-user=vagrant \
--with-fpm-group=nogroup \
--enable-wddx \
--with-curl \
--with-mcrypt \
--with-iconv \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-freetype-dir=/usr \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-openssl \
--with-pdo-mysql=mysqlnd \
--with-gettext=/usr \
--with-zlib=/usr \
--with-bz2=/usr \
--with-recode=/usr \
--with-xmlrpc \
--with-mysqli=mysqlnd
make -j 4
make test
make install
copy相关文件:
进入php7解压的文件夹
cp -a php.ini-production /webser/php7/php.ini
cp sapi/fpm/init.d.php-fpm /etc/init.d/php7-fpm
chmod +x /etc/init.d/php7-fpm
cd /webser/php7
cp /webser/php7/etc/php-fpm.conf.default /webser/php7/etc/php-fpm.conf
cp /webser/php7/etc/php-fpm.d/www.conf.default //php7/etc/php-fpm.d/
www.conf
修改 www.conf文件:
修改以下字段即可:
user=www
group=www
listen = 127.0.0.1:9007 (默认为9000,以免和系统的php5.3版本冲突,所以起个其他端口)
相关文章推荐
- 一个关于if else容易迷惑的问题
- 从源码安装Mysql/Percona 5.5
- PHP5.2.*防止Hash冲突拒绝服务攻击的Patch
- 深入理解PHP之匿名函数
- Centos6 编译安装Python
- JSP/PHP基于Ajax的分页功能实现
- 关于PHP通过PDO用中文条件查询MySQL的问题。
- 什么是设计模式
- 硬盘安装CentOS 6.2以及添加GRUB启动菜单
- CentOS 6.2实战部署Nginx+MySQL+PHP
- PHP数据库长连接mysql_pconnect的细节
- CentOS 7系统配置上的变化解析
- Php Installing An Expansion
- rem : web app适配的秘密武器
- php7 读取php.ini[4]
- CentOS下DB2数据库安装过程详解
- CentOS 6.3下编译安装Ruby 2.0笔记