PHP compiled installation script

Source: Internet
Author: User

#!/bin/bash
#Date: 2017-05-05 by Allen_jol
#---------YUm Install Related components------
Sleep 3


Yum install-y gcc gcc-c++ autoconf automake libtool make CMake libjpeg libjpeg-devel libpng libpng-devel freetype Freetyp E-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel NC Urses Ncurses-devel Curl openssl-devel gdbm-devel db4-devel libxpm-devel libx11-devel gd-devel gmp-devel readline-devel L Ibxslt-devel expat-devel xmlrpc-c xmlrpc-c-devel libmcrypt libmcrypt-devel bison-devel OpenSSL openssl-devel zlib Zlib-devel Pcre Pcre-devel



Mkdir/lnmpsoftware

#-----------Download PHP Server-----------------


Sleep 3
Cd/lnmpsoftware


TAR-ZXVF libmcrypt-2.5.8.tar.gz
TAR-ZXVF mhash-0.9.9.9.tar.gz


cd/lnmpsoftware/libmcrypt-2.5.8
./configure
Make && make install
Sleep 3


#cd: I took the php script alone, and when I did the PHP test, I needed to switch to/USR/LOCAL/SRC.


Cd/lnmpsoftware
CD mhash-0.9.9.9
./configure
Make && make install


Sleep 3


Cd/lnmpsoftware


if [!-F php-7.0.6.tar.gz]
Then
Wget-o php-7.0.6.tar.gz Http://cn2.php.net/get/php-7.0.6.tar.gz/from/this/mirror
Fi
#--------------Install PHP Server-----------------


TAR-ZXVF php-7.0.6.tar.gz
CD php-7.0.6
if [!-f/usr/local/php/etc/php.ini]
Then
./buildconf--force
./configure \
--prefix=/usr/local/php \
--WITH-CONFIG-FILE-PATH=/USR/LOCAL/PHP/ETC \
--WITH-CONFIG-FILE-SCAN-DIR=/USR/LOCAL/PHP/ETC/CONF.D \
--ENABLE-FPM \
--WITH-FPM-USER=WWW \
--WITH-FPM-GROUP=WWW \
--ENABLE-SOAP \
--WITH-OPENSSL \
--with-openssl-dir \
--with-mcrypt \
--with-pcre-regex \
--with-zlib \
--with-iconv \
--WITH-BZ2 \
--enable-calendar \
--with-curl \
--WITH-CDB \
--enable-dom \
--ENABLE-EXIF \
--with-pcre-dir \
--ENABLE-FTP \
--WITH-GD \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-gettext \
--WITH-GMP \
--with-mhash \
--enable-mbstring \
--WITH-LIBMBFL \
--with-onig \
--ENABLE-PDO \
--with-pdo-mysql \
--with-zlib-dir \
--with-readline \
--enable-session \
--ENABLE-SHMOP \
--enable-simplexml \
--enable-sockets \
--ENABLE-SYSVMSG \
--enable-sysvsem \
--ENABLE-SYSVSHM \
--ENABLE-WDDX \
--with-libxml-dir \
--with-xsl \
--enable-zip \
--ENABLE-MYSQLND \
--WITH-MYSQLI \
--without-pear
Sleep 3


Make-j 4 && make install


Fi



Cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf
Cp/usr/local/php/etc/php-fpm.d/www.conf.default/usr/local/php/etc/php-fpm.d/www.conf


CP Php.ini-production/usr/local/php/etc/php.ini
CP SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP-FPM
chmod +x/etc/init.d/php-fpm
Chkconfig--add PHP-FPM
Chkconfig PHP-FPM on
Groupadd www
Useradd-s/sbin/nologin-g www-m www


Sed-ri-e ' s#;d ate.timezone = #date. TimeZone = Prc#g '-e ' s#;cgi.fix_pathinfo=1#cgi.fix_pathinfo=0#g '/usr/local/php/ Etc/php.ini


Iptables-i input-p TCP--dport 80-j ACCEPT
Service Iptables Save


This article is from the "high-tech Library" blog, please be sure to keep this source http://gaopengju.blog.51cto.com/12830710/1947606

PHP compiled installation script

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.