PHP Compilation Installation

Source: Internet
Author: User
Tags bz2 curl fpm openldap

First, preface(i), overview(ii), pretreatment
   Configure the Environment  Os:centos   64bit PHP version:  7.2 . 8  hostname : php- 1 - IP:  10.18 . 43.141   
 [[email protected]1 -1  ~]# systemctl stop Firewalld[[email  protected] -1 -1  ~]# sed -ri  " /^selinux=*/cselinux= Disabled   "/etc/selinux/config[[email  protected] -1 -1  ~]# Setenforce 0  [[email protected] - Span style= "color: #800080;" >1 -1  ~]# mkdir -P/date /php  
Second, installation(i), PHP compilation

Dependent Environment Library Download

[[Email protected]1-1yuminstallgccgcc make bzip2bzip2-devel ncurses ncurses-devel Curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel OpenSSL Openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libxslt libxslt-devel

Source Package Acquisition and compilation

 [[email protected]1 -1  ~]# wget -p/data/php/http:< Span style= "color: #008000;" >// cn2.php.net/distributions/php-7.2.8.tar.bz2  [[email  Protected]1 -[[email protected] -1 -1  php]# tar  XF php-8 . tar . bz2  
[[email  protected] php]# cd php-7.2.8/
[email protected] php-7.2.8]#./configure \
--prefix=/usr/local/php \
--with-curl \
--with-freetype-dir \
--with-gd \
--with-ldap \
--with-gettext \
--with-iconv-dir \
--with-jpeg-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-mbregex \
--enable-mbstring \
--enable-opcache \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvsem \
--enable-xml \
--enable-zip \
--with-fpm-group=nginx \
--with-fpm-user=nginx
third, configuration start(i), basic configuration
[[Email protected]1-1php-7.2.8]#CPsapi/fpm/php-fpm.service/usr/lib/systemd/system/[[Email protected]-1-1php-7.2.8]#CP/usr/local/php/etc/{php-fpm.conf.default,php-fpm.conf} [[Email protected]-1-1php-7.2.8]#CP/usr/local/php/etc/php-fpm.d/Www.conf{.default,}[[email protected]-1-1php-7.2.8]#CPPhp.ini-production/usr/local/php/lib/php.ini
(b), parameter configuration
[[Email protected]1-1php-7.2.8]#sed-I.'/date.timezone =/s/.*/date.timezone = prc/g'/usr/local/php/lib/Php.ini[[email protected]-1-1php-7.2.8]#sed-N'869p'/usr/local/php/lib/Php.ini[[email protected]-1-1php-7.2.8]#sed-I.'/opcache]/azend_extension=opcache.so'/usr/local/php/lib/Php.ini[[email protected]-1-1php-7.2.8]#sed-I.'/;opcache.enable=1/s/;//g'/usr/local/php/lib/Php.ini[[email protected]-1-1php-7.2.8]#sed-I.'/opcache.enable_cli=/s/.*/opcache.enable_cli=1/g'/usr/local/php/lib/Php.ini[[email protected]-1-1php-7.2.8]#Echo "vm.nr_hugepages =">>/etc/Sysctl.conf[[email protected]-1-1php-7.2.8]# Sysctl-P[[email protected]-1-1php-7.2.8]#sed-I.'/;opcache.huge_code_pages/s/;//g'/usr/local/php/lib/Php.ini[[email protected]-1-1php-7.2.8]#sed-I.'/opcache.memory_consumption=/s/.*/opcache.memory_consumption=512/g'/usr/local/php/lib/Php.ini[[email protected]-1-1php-7.2.8]#sed-I.'/opcache.fast_shutdown=/s/.*/opcache.fast_shutdown=1/g'/usr/local/php/lib/Php.ini[[email protected]-1-1php-7.2.8]#sed-I.'/opcache.validate_timestamps=/s/.*/opcache.validate_timestamps=1/g'/usr/local/php/lib/Php.ini[[email protected]-1-1php-7.2.8]#sed-I.'/opcache.revalidate_freq=/s/.*/opcache.revalidate_freq=2/g'/usr/local/php/lib/Php.ini[[email protected]-1-1php-7.2.8]#sed-I.'/listen = 127.0.0.1/s/=.*/= 0.0.0.0:9000/g'/usr/local/php/etc/php-fpm.d/www.conf
(iii), start-up use
[Email protected]1-1 php-7.2. 8] # systemctl Start php-fpm.service[[email protected]-1-1 php-7.2.  8]# Systemctl enable Php-fpm.service

PHP Compilation Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.