前言由于很多新手问我如何编译安装,所以我整理一下。学会编译安装,无论是开发还是运维,都是必须掌握的硬性要求。PHP依赖于yuminstalllibxml2-develbzip2-devellibcurl-devellibpng-devellibXpm-devellibjpeg-turbo-develgmp-develfreetype-devellibvpx-develkrb5-develzlib-develpcre-develpam-developensslopenssl-devellibmcryptlibmcrypt-devellibmcryptlibmcrypt-devel可能不存在需要添加repo yuminstallepel-releaseyuminstalllibmcryptlibmcrypt-devel安装步骤参考下载包wgethttp://php.net/get/php-7.2。5....展开区别PHP7.2enable-gd-native-ttf和-mcrypt不再支持编译参数酌情加减(可以移步其他文章了解参数PHP编译参数详解)./configure--prefix=/opt/php72--with-config-file-scan-dir=/opt/php72/etc/php.d--disable-debug--with-pic--with-bz2--with-gettext--with-gmp--enable-mbregex--enable-mbstring--with-openssl--with-zlib--with-layout=GNU--enable-exif--enable-zip--enable-套接字--enable-xml--with-pear--enable-fpm--with-pdo-mysql--with-curl--with-gd--with-mysqli--enable-soap--with-fpm-user=www--with-fpm-group=www--with-freetype-dir--enable-mbstring--enable-bcmath--with-jpeg-dir--with-ldap-dir配置文件整理cpphp-fpm.conf.defaultphp-fpm.confcpwww.conf.defaultwww.confcpphp.ini-production/opt/php72/etc/php.ini从源包中复制php.ini配置nginx安装步骤参考yuminstallgcc#编译需要yuminstall-ypcre-devel#rewriteyuminstall-yzlib-devel#HTTPgzipyuminstallopenssl*#支持sslwgethttp://nginx.org/download/ngi...tarxvzfnginx-1.11.5.tar.gz./configure--prefix=/opt/nginx--user=www--group=www--with-http_ssl_module--with-pcremake&&makeinstall常用编译参数说明。/configure--help./configure--prefix=/opt/nginx--user=apache--group=apache--with-http_stub_status_module:支持nginx状态查询--with-http_ssl_module:支持https--with-http_spdy_module:支持谷歌的spdy,想知道的请百度spdy,这个必须要有ssl的支持--with-pcre:为了支持rewrite功能,必须制定pcre
