Installing php7.2

Source: Internet
Author: User
Tags fpm pear php cli openldap

Yum-y install gcc gcc-c++ gd cmake patch automakemake autoconf libjpeg libjpeg-devel libpng libpng-devel freetype Freetyp E-DEVELLIBXML2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2-devel bzip2bzip2-devel ncurses ncurses-devel Curl CU Rl-devel e2fsprogs e2fsprogs-develkrb5 krb5-devel libidn libtools-libs libidn-devel OpenSSL Openssl-developenldap Openldap-devel nss_ldap openldap-clients openldap-servers pcre-devel libmcrypt-devel readline-devellibcap-devel Bzip2-devel Libxpm-devel Postgresql-devel

wget Http://cn2.php.net/get/php-7.2.0.tar.gz/from/this/mirror

MV Mirror php-7.2.0.tar.gz

Tar zxf php-7.2.0.tar.gz

CD php-7.2.0/

./configure--prefix=/usr/local/php--with-pdo-pgsql--with-zlib-dir--with-freetype-dir--enable-mbstring-- WITH-LIBXML-DIR=/USR--enable-soap--enable-calendar--with-curl--with-mcrypt--with-gd--with-pgsql--disable-rpath --enable-inline-optimization--with-bz2--with-zlib--enable-sockets--enable-sysvsem--ENABLE-SYSVSHM-- Enable-pcntl--enable-mbregex--enable-exif--enable-bcmath--with-mhash--enable-zip--with-pcre-regex-- With-pdo-mysql--with-mysqli--with-jpeg-dir=/usr--with-png-dir=/usr--enable-gd-native-ttf--with-openssl-- With-fpm-user=www-data--with-fpm-group=www-data--with-libdir=/lib/x86_64-linux-gnu/--enable-ftp--with-gettext- -with-xmlrpc--with-xsl--enable-opcache--enable-fpm--with-iconv--with-xpm-dir=/usr

Make && make install

CP Php.ini-development/usr/local/php/lib/php.ini

Vim/etc/profile
Path= $PATH:/usr/local/php/bin
Export PATH

Source/etc/profile

Configure PHP-FPM
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/home/tools/php-7.2.0/sapi/fpm/php-fpm/etc/init.d/php-fpm
chmod +x/etc/init.d/php-fpm

New User Group
Groupadd Www-data
Useradd-g Www-data Www-data

Start
/etc/init.d/php-fpm

Managing with Scripts
vim/etc/init.d/php-fpm
#!/bin/sh

. /etc/rc.d/init.d/functions

Source networking configuration.

. /etc/sysconfig/network

Check that networking are up.

["$NETWORKING" = "no"] && exit 0

Phpfpm= "/USR/LOCAL/PHP/SBIN/PHP-FPM"
prog=$ (basename ${phpfpm})

lockfile=/var/lock/subsys/phpfpm

Start () {
[-X ${PHPFPM}] | | Exit 5
Echo-n $ "Starting $prog:"
Daemon ${PHPFPM}
Retval=$?
Echo
[$retval-eq 0] && Touch $lockfile
Return $retval
}

Stop () {
Echo-n $ "Stopping $prog:"
Killproc $prog-quit
Retval=$?
Echo
[$retval-eq 0] && rm-f $lockfile
Return $retval
}

Restart () {
Configtest | | Return $?
Stop
Start
}

Reload () {
Configtest | | Return $?
Echo-n $ "Reloading $prog:"
Killproc ${PHPFPM}-hup
Retval=$?
Echo
}

Force_reload () {
Restart
}

Configtest () {
${PHPFPM}-T
}

Rh_status () {
Status $prog
}

Rh_status_q () {
Rh_status >/dev/null 2>&1
}

Case "$" in
Start
Rh_status_q && Exit 0
$
;;
Stop
Rh_status_q | | Exit 0
$
;;
Restart|configtest)
$
;;
Reload
Rh_status_q | | Exit 7
$
;;
Status
Rh_status
;;
*)
echo $ "Usage: $ {start|stop|status|restart|reload|configtest}"
Exit 2
Esac

Add to boot startup item
Chkconfig--add PHP-FPM

Related paths
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/
Installing PHP CLI binary:/usr/local/php/bin/
Installing PHP CLI man page:/usr/local/php/php/man/man1/
Installing PHP FPM binary:/usr/local/php/sbin/
Installing PHP FPM defconfig:/usr/local/php/etc/
Installing PHP FPM man page:/usr/local/php/php/man/man8/
Installing PHP FPM Status page:/usr/local/php/php/php/fpm/
Installing phpdbg binary:/usr/local/php/bin/
Installing phpdbg man page:/usr/local/php/php/man/man1/
Installing PHP CGI binary:/usr/local/php/bin/
Installing PHP CGI man page:/usr/local/php/php/man/man1/
Installing Build Environment:/usr/local/php/lib/php/build/
Installing header files:/usr/local/php/include/php/
Installing helper Programs:/usr/local/php/bin/
Program:phpize
Program:php-config
Installing man pages:/usr/local/php/php/man/man1/
Page:phpize.1
Page:php-config.1
Installing PEAR Environment:/usr/local/php/lib/php/
[PEAR] archive_tar-installed:1.4.3
[PEAR] console_getopt-installed:1.4.1
[PEAR] structures_graph-installed:1.1.1
[PEAR] xml_util-installed:1.4.2
[PEAR] pear-installed:1.10.5
Wrote PEAR system config file at:/usr/local/php/etc/pear.conf
Want to add:/usr/local/php/lib/php to your php.ini include_path
/home/tools/php-7.2.0/build/shtool install-c Ext/phar/phar.phar/usr/local/php/bin
Ln-s-F Phar.phar/usr/local/php/bin/phar
Installing PDO headers:/usr/local/php/include/php/ext/pdo/

Installing php7.2

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.