centos编译安装php

2021-02-04 14:17

阅读:581

标签:openssl   解压   开发   libxml   write   config   wget   toc   emd   

1,安装wget命令
yum install wget

2,在/usr/local/src目录下载源码包
wget http://cn2.php.net/distributions/php-7.2.4.tar.gz

解压源码包
tar zxvf php-7.2.4.tar.gz
技术图片

3,安装编译php需要的依赖包
yum install gcc autoconf gcc-c++
yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel readline readline-devel libxslt libxslt-devel

yum install systemd-devel
yum install openjpeg-devel

添加php-fpm用户
创建群组
groupadd php-fpm
创建一个用户,不允许登陆和不创主目录

useradd -s /sbin/nologin -g php-fpm -M php-fpm

开发环境:
--enable-phpdbg
--enable-dtrace
生产环境:
--disable-phpdbg
--disable-dtrace\

cd /usr/local/src/php-7.2.4
编译:
./configure \ --prefix=/usr/local/php \ --with-config-file-path=/usr/local/php/etc \ --with-zlib-dir \ --with-freetype-dir \ --enable-mbstring \ --with-libxml-dir=/usr \ --enable-xmlreader \ --enable-xmlwriter \ --enable-soap \ --enable-calendar \ --with-curl \ --with-zlib \ --with-gd \ --with-pdo-sqlite \ --with-pdo-mysql \ --with-mysqli \ --with-mysql-sock \ --enable-mysqlnd \ --disable-rpath \ --enable-inline-optimization \ --with-bz2 \ --with-zlib \ --enable-sockets \ --enable-sysvsem \ --enable-sysvshm \ --enable-pcntl \ --enable-mbregex \ --enable-exif \ --enable-bcmath \ --with-mhash \ --enable-zip \ --with-pcre-regex \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \ --with-openssl \ --enable-ftp \ --with-kerberos \ --with-gettext \ --with-xmlrpc \ --with-xsl \ --enable-fpm \ --with-fpm-user=php-fpm \ --with-fpm-group=php-fpm \ --with-fpm-systemd \ --disable-fileinfo

执行编译:
make && make install

centos编译安装php

标签:openssl   解压   开发   libxml   write   config   wget   toc   emd   

原文地址:https://www.cnblogs.com/stronger-xsw/p/13140009.html


评论


亲,登录后才可以留言!