PHP7.0 Install Note _php instance

Source: Internet
Author: User
Tags create directory fpm php website sapi scalar unsupported zend git clone

June 11, 2015, the official website of PHP released news, officially released PHP7 first version of the Alpha version.

PHP7 Features:

PHP 7.0.0 Alpha 1 uses the new version of the Zendengine engine, bringing a number of newer features, the following is an incomplete list:

(1) Performance improvement: PHP7 than PHP5.6 performance increased by twice times. Improved performance:php 7 is up to twice as fast as PHP 5.6

(2) Full and consistent 64-bit support. Consistent 64-bit Support

(3) Many of the previous fatal errors are now changed to throw exceptions. Many fatal errors are now exceptions

(4) Remove some old unsupported SAPI (server-side application programming ports) and extensions. Removal of the old and unsupported Sapis and extensions

(5) Added the null engagement operator. The null coalescing operator (??)

(6) The new combined comparison operator is added. Combined comparison Operator (<=>)

(7) The new return type declaration of the function is added. return Type Declarations

(8) A new scalar type declaration has been added. Scalar Type Declarations

(9) New addition of anonymous classes. Anonymous Classes

PHP7 Installation Note-fixing

# Install MCrypt

Yum install-y php-mcrypt Libmcrypt libmcrypt-devel

# Upgrade Bison

cd/var/soft/
wget http://ftp.gnu.org/gnu/bison/bison-2.6.4.tar.gz
tar-xvzf bison-2.6.4.tar.gz 
CD bison-2.6.4
./configure make
&& make install

# upgrade RE2C, resolve you'll need re2c 0.13.4 or later if you want to regenerate PHP

Parsers. Error

cd/var/soft/
wget http://sourceforge.net/projects/re2c/files/re2c/0.13.5/re2c-0.13.5.tar.gz/download
Tar zxf re2c-0.13.5.tar.gz && cd re2c-0.13.5
./configure make
&& make install

Compiling PHP7

# Create directory mkdir-p/var/soft/php7 cd/var/soft/php7 # Download the source code git clone http://git.php.net/repository/php-src.git CD php-src. /BUILDCONF # configuration parameters./configure--prefix=/usr/local/php7 \--with-config-file-path=/usr/local/php7/etc \--with-mcrypt=/ Usr/include \--with-mysql=mysqlnd \--with-mysqli=mysqlnd \--with-pdo-mysql=mysqlnd \--with-gd \--with-iconv \--with- zlib \--enable-xml \--enable-bcmath \--enable-shmop \--enable-sysvsem \--enable-inline-optimization \--enable-mbrege x \--enable-fpm \--enable-mbstring \--enable-ftp \--enable-gd-native-ttf \--with-openssl \--enable-pcntl \--enable- Sockets \--WITH-XMLRPC \--enable-zip \--enable-soap \--without-pear \--with-gettext \--enable-session \--with-curl \--with-jpeg-dir \--with-freetype-dir \--enable-opcache #########################################################
######################## #/encodings.c:101:undefined reference to ' Libiconv_close ' error when compiling PHP install # The following error occurred while installing PHP: #/root/downloads/php-5.6.5/ext/xmlrpc/libxmlrpc/encodings.c:73:undefined reference to ' Libiconv_open ' #/root/downloads/php-5.6.5/ext/xmlrpc/ libxmlrpc/encodings.c:81:undefined reference to ' Libiconv ' #/root/downloads/php-5.6.5/ext/xmlrpc/libxmlrpc/ encodings.c:101:undefined reference to ' Libiconv_close ' #/root/downloads/php-5.6.5/ext/xmlrpc/libxmlrpc/ encodings.c:101:undefined reference to ' libiconv_close ' * Collect2:error:ld returned 1 exit status # Make: * * * SAPI/CL I/php] Error 1 # According to the PHP website described this is a bug (https://bugs.php.net/bug.php?id=52611). After configure to manually modify the makefile file, find extra_libs at the end of the-liconv can be successfully passed # (approximately in makefile file of the) # extra_libs =-lcrypt-lz-lresolv- Lcrypt-lrt-lmysqlclient-lmcrypt-lltdl-lpng-lz-ljpeg-lcurl-lz-lrt-lm-ldl-lnsl-lxml2-lz-lm-ldl-lssl-lcryp  To-lcurl-lxml2-lz-lm-ldl-lfreetype-lmysqlclient-lz-lm-lssl-lcrypto-ldl-lxml2-lz-lm-ldl-lxml2-lz-lm-ldl -lcrypt-lxml2-lz-lm-ldl-lxml2-lz-lm-ldl-lxml2-lz-lm-ldl-lxml2-lz-lm-ldl-lssl-lcrypto-lcrypt-licOnv ################################################################################# # Compile installation make && sudo Make install

# Configuration

CP Php.ini-production/usr/local/php7/etc/php.ini
CP sapi/fpm/init.d.php-fpm/etc/init.d/php7-fpm
chmod +x/ ETC/INIT.D/PHP7-FPM
cp/usr/local/php7/etc/php-fpm.conf.default/usr/local/php7/etc/php-fpm.conf
cp/usr/ Local/php7/etc/php-fpm.d/www.conf.default/usr/local/php7/etc/php-fpm.d/www.conf

# Configure Opcache

Vim/usr/local/php7/etc/php.ini
# Join
zend_extension=/usr/local/php7/lib/php/extensions/ No-debug-non-zts-20141001/opcache.so
# starts
/etc/init.d/php7-fpm start

# View PHP Version

/usr/local/php7/bin/php-v

Results:

PHP 7.0.0-dev (CLI) (Built:mar 3 2015 10:02:26) 
Copyright (c) 1997-2015 the PHP Group
Zend Engine, Cop Yright (c) 1998-2015 Zend Technologies
  with Zend Opcache V7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies

The above is the article to share the PHP7.0 installation notes to organize, hope to help everyone.

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.