Detailed explanation of install examples in php

黄舟
Release: 2023-03-15 21:36:02
Original
1330 people have browsed it

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
Copy after login

//Download php


wget http://php.net/distributions/php-7.0.23.tar.xz
Copy after login

//Unzip


xz -d php-7.0.23.tar.xz
Copy after login

//Unpack


tar xvf php-7.0.23.tarcd php-7.0.23
Copy after login

//Compilation-specific configuration options google and Baidu queries have 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
Copy after login

note: "Pay attention to whether there are errors and missing dependencies in the configuration If there is a prompt for the package, add it yourself "

Compile and install

make&&make install
Copy after login

Configuration file cp

//php- The reference file of fpm

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
Copy after login

//Move the php-fpm startup to init.d and start it at boot

cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm
Copy after login

# php -v It will be ok if the following prompt appears

The above is the detailed content of Detailed explanation of install examples in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!