Linux compile and install PHP7 and install Redis extended swoole Extensions

Source: Internet
Author: User
Tags fpm ini redis zip install redis

Compiling installation PHP7 and installing Redis Extended swoole Extensions

On the machine that compiles PHP7, there is already a version that has been installed over php5.3, thereby relying on the library to have

This php7 is compiled into fpm-php use,

If it's Apache then the compile parameter should be

--with-apxs2=/usr/local/apache/bin/apxs

Compile and install PHP7

Wget-c http://www.php.net/distributions/php-7.0.0.tar.gz
Tar zxvf php-7.0.0.tar.gz
CD php-7.0.0

./configure \
--PREFIX=/USR/LOCAL/PHP7 \
--WITH-CONFIG-FILE-PATH=/USR/LOCAL/PHP7/ETC \
--ENABLE-FPM \
--WITH-FPM-USER=WWW \
--WITH-FPM-GROUP=WWW \
--WITH-MYSQLI=MYSQLND \
--WITH-PDO-MYSQL=MYSQLND \
--with-iconv-dir \
--with-freetype-dir=/usr/local/freetype \
--with-jpeg-dir-\
-with-png-dir \
--with-zlib \
--WITH-LIBXML-DIR=/USR \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--ENABLE-SHMOP \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-mbstring \
--with-mcrypt \
--ENABLE-FTP \
--WITH-GD \
--ENABLE-GD-NATIVE-TTF \
--WITH-OPENSSL \
--with-mhash \
--ENABLE-PCNTL \
--enable-sockets \
--WITH-XMLRPC \
--enable-zip \
--ENABLE-SOAP \
--with-gettext \
--disable-fileinfo \
--enable-opcache

Make zend_extra_libs= '-liconv '

Make install

CP Php.ini-production/usr/local/php7/etc/php.ini

Cd..

Compiling Redis extension support for installation PHP7


Wget-c Https://github.com/phpredis/phpredis/archive/php7.zip
Unzip Php7.zip

CD PHPREDIS-PHP7
/usr/local/php7/bin/phpize
./configure--with-php-config=/usr/local/php7/bin/php-config
Make
Make install
Cd..

/usr/local/php7/etc/php.ini

Added in

Extension=redis.so

Compile and install PHP7 Swoole


Wget-c https://github.com/swoole/swoole-src/archive/swoole-1.7.21-stable.tar.gz
Tar zxvf swoole-1.7.21-stable.tar.gz
CD swoole-src-swoole-1.7.21-stable/
/usr/local/php7/bin/phpize
./configure--with-php-config=/usr/local/php7/bin/php-config
Make
Make install
Cd..

/usr/local/php7/etc/php.ini

Added in

Extension=swoole.so

Related Article

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.