PHP7.0 Installation notes and php7.0 notes
On July 6, June 11, 2015, the PHP official website published a message, officially releasing the first alpha version of PHP7.
PHP 7 features:
PHP 7.0.0 Alpha 1 uses the new version of ZendEngine, which brings many new features. The following is an incomplete list:
(1) Performance Improvement: PHP7 is twice better than PHP5.6. Improved performance: PHP 7 is up to twice as fast as PHP 5.6.
(2) fully consistent 64-bit support. Consistent 64-bit support
(3) many previous fatal errors are thrown. Specified fatal errors are now Exceptions
(4) removed some old sapis (server-side application programming ports) and extensions that are not supported. Removal of old and unsupported SAPIs and extensions
(5) added the null join operator. The null coalescing operator (??)
(6) A new comparison operator is added. Combined comparison Operator (<=>)
(7) The return type declaration of the function is added. Return Type Declarations
(8) A scalar type declaration is added. Scalar Type Declarations
(9) add an anonymous class. Anonymous Classes
PHP 7 Installation notes
# 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.gztar -xvzf bison-2.6.4.tar.gz cd bison-2.6.4./configuremake && make install
# Upgrade re2c to solve the problem You will 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/downloadtar zxf re2c-0.13.5.tar.gz && cd re2c-0.13.5./configuremake && make install
Compile PHP7
# Create directory mkdir-p/var/soft/php7cd/var/soft/php7 # download source code git clone http://git.php.net/repository/php-src.gitcd php-src. /buildconf # configure 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 \ -- e Nable-sysvsem \ -- enable-inline-optimization \ -- enable-mbregex \ -- 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 appears during php compilation and installation. c: 101: undefined reference to 'libiconv _ close' solution # the following error occurs when 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 ref Erence 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/cli/php] Error 1 # according to php official website Description This is a bug (https://bugs.php.net/bug.php? Id = 52611 ). After configure, You need to manually modify the Makefile file, find EXTRA_LIBS, and add-liconv at the end. # (about 104 of the Makefile file) # EXTRA_LIBS =-lcrypt-lz-lresolv-lcrypt-lrt-lmysqlclient-lmcrypt-lltdl-lpng-lz-ljpeg-lcurl-lz-lrt-lm-ldl-lnsl-lxml2- lz-lm-ldl-lssl-lcrypto-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 and install make & sudo make install
# Configuration
cp php.ini-production /usr/local/php7/etc/php.inicp sapi/fpm/init.d.php-fpm /etc/init.d/php7-fpmchmod +x /etc/init.d/php7-fpmcp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.confcp /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 # Add zend_extension =/usr/local/php7/lib/php/extensions/no-debug-non-zts-20141001/opcache. so # Start/etc/init. d/php7-fpm start
# View the PHP version
/usr/local/php7/bin/php -v
Result:
PHP 7.0.0-dev (cli) (built: Mar 3 2015 10:02:26) Copyright (c) 1997-2015 The PHP GroupZend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
The above is the PHP7.0 Installation notes shared in this article. I hope this will help you.