Home > Article > Backend Development > PHP install method
PHP7 integrates Fastcgi
The startup item becomes php-fpm
First, you must install the dependent libraries required by php
yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-defel libxml2 libxml2-devel pcre-devel curl-devel libxslt-devel
//Download php
wget http://php.net/distributions/php-7.0.23.tar.xz
//Unzip
xz -d php-7.0.23.tar.xz
//Unpack
tar xvf php-7.0.23.tarcd php-7.0.23
//Compilation-specific configuration options Google Baidu query has explanations
# ./configure --prefix=/usr/local/php \ --sbin-path=/usr/sbin/php \ --bin-path=/usr/bin/php \ --with-curl \ --with-freetype-dir \ --with-gd \ --with-gettext \ --with-iconv-dir \ --with-kerberos \ --with-libdir=lib64 \ --with-libxml-dir \ --with-mysqli \ --with-openssl \ --with-pcre-regex \ --with-pdo-mysql \ --with-pdo-sqlite \ --with-pear \ --with-png-dir \ --with-xmlrpc \ --with-xsl \ --with-zlib \ --enable-fpm \ --enable-bcmath \ --enable-libxml \ --enable-inline-optimization \ --enable-gd-native-ttf \ --enable-mbregex \ --enable-mbstring \ --enable-opcache \ --enable-pcntl \ --enable-shmop \ --enable-soap \ --enable-sockets \ --enable-sysvsem \ --enable-xml \ --enable-zip
note: "In Pay attention to whether there are errors or missing dependency packages in the configuration. If so, add "
Compile and install
make&&make install
Configuration file cp
//Reference file of php-fpm
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
//Move php-fpm startup to init.d Start up
cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm
# php -v It will be ok if the following prompt appears
The above is the detailed content of PHP install method. For more information, please follow other related articles on the PHP Chinese website!