This article mainly introduces the Linux compilation installs the php7.2, has the certain reference value, now shares to everybody, has the need friend to refer to
PHP Compilation Installation
Add user
Useradd-r-s/sbin/nologin PHP-FPM
Download the Unzip installation package
Cd/data/pkgwget http://php.net/get/php-7.2.2.tar.gz/from/this/mirror MV Mirror Php-7.2.2.tar.gztar ZXVF PHP-7.2.2.TAR.GZCD php-7.2.2
Installation dependencies
Yum-y install libxml2 libxml2-devel OpenSSL openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt -devel libxslt Libicu-devel Libxslt-devel
Compiling the installation
./configure \--prefix=/usr/local/php-7.2.2 \--with-mhash \--with-openssl \--with-config-file-path=/usr/local/ Php-7.2.2/etc \--disable-short-tags \--enable-fpm \--with-fpm-user=php-fpm--with-fpm-group=php-fpm \--enable-xml \- -with-libxml-dir \--enable-bcmath \--enable-calendar \--enable-intl \--enable-mbstring \--enable-pcntl \-- Enable-shmop \--enable-soap \--enable-sockets \--enable-zip \--enable-mbregex \--enable-mysqlnd \-- Enable-mysqlnd-compression-support \--with-mysqli=mysqlnd \--with-pdo-mysql=mysqlnd \--with-gd \--enable-ftp \-- With-curl \--with-xsl \--with-iconv \--with-freetype-dir \--with-jpeg-dir \--with-png-dir \--with-zlib \-- Enable-sysvsem \--enable-inline-optimization \--with-xmlrpc \--with-gettextmake-j 4 && make install
Building a soft chain
Ln-s/usr/local/php-7.2.2//usr/local/phpln-s/usr/local/php/bin/php/usr/local/binln-s/usr/local/php/sbin/php-fpm /usr/local/sbin
To set up a php-fpm running user
CD/DATA/PKG/PHP-7.2.2CP./php.ini-development./php.ini-production/usr/local/php/etccp/usr/local/php/etc/ php.ini-development/usr/local/php/etc/php.inicp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/ Php-fpm.confcp/usr/local/php/etc/php-fpm.d/www.conf.default/usr/local/php/etc/php-fpm.d/www.conf
Building a soft chain
Ln-s/usr/local/php/etc/php.ini/usr/local/etc/ln-s/usr/local/php/etc/php-fpm.conf/usr/local/etc/ln-s/usr/local/ php/etc/php-fpm.d/www.conf/usr/local/etc/
Configuring environment variables, adding global commands
Vim/etc/profilepath= $PATH:/usr/local/php/binexport pathsource/etc/profile
Start the PHP-FPM service
/usr/local/sbin/php-fpm
See if it starts
netstat-lnt | grep 9000
Kill PHP-FPM
Killall PHP-FPM
The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!
Related recommendations:
Linux compiled installation mysql5.7
Use of the PHP7.2 Data structures