PHPNG is the Next Version of PHP, Which in Real Life Tests Shows To Be More Faster and Reliable Than HHVM. We Can Easily Upgrade PHP5 to PHPNG. We wrote about HHVM before. Although, HHVM has been better in terms of compatibility than HHVM 3.6.0 LTS, yet as decided; we have ended support of HHVM related articles for normal PHP-MySQL based web softwares. Those who are not aware, PHPNG is a new development branch of PHP that, in reality, it will never see the light of the final release except in the form of the new version of PHP 7 – the major release of PHP. In other words, you need to compile PHPNG at this moment for the upgrade.
PHPNG : How it Became Official Part of PHP
Developers of Zend had attempted to introduce JIT Compilation engine in the existing PHP which gave pathetic results in the real world because of the mismanagement of memory allocation. Experiments conducted by Zend proved that, in the way the engine is currently designed, needed a change. NG patch changes the norm of using zvals, increasing performance and tidier API.
PHPNG : Official Guides
You can check the official websites for more information on PHPNG :
---
1 2 | https://wiki.php.net/phpng-upgrading http://www.phpclasses.org/blog/post/234-PHPNG-Dramatic-Speedup-Features-Coming-in-PHP-6-Release.html |
We recommend to spin a new server instance from OpenStack snapshot and do the steps for up-gradation before applying the changes on deployment server.
How To Upgrade PHPNG From PHP5 on Nginx PHP5-FPM Setup?
Obviously, on PHP-FPM there is the PHP part, for which we write as PHP5-FPM
. We can upgrade that PHP5
to PHP7
. We can not give warranty about W3 Total Cache Plugin.
We are are providing the needed commands to install on a running Ubuntu 14.04 LTS Server’s PHP5-FPM :
First stop PHP-FPM and Nginx :
1 2 | service php5-fpm stop service nginx stop |
We would recommend to use this first :
1 | http://repos.zend.com/zend-server/early-access/phpng/dists/trusty/ |
This is PHP 5.7 and is PHPNG. Installing PHP 7 dev will need 100% manual work. Above package has paths which are the same ones as Ubuntu’s standard. Pain is lesser.
1 2 3 4 5 | cd /opt wget http://repos.zend.com/zend.key -O- 2> /dev/null | apt-key add - echo "deb [arch=amd64] http://repos.zend.com/zend-server/early-access/phpng/ trusty zend" > /etc/apt/sources.list.d/phpng.list apt-get update apt-get install php5 |
Start the services :
1 2 | service php5-fpm start service nginx start |
If you run php -v
:
1 2 3 4 | PHP 5.7.0-dev (cli) (built: Jul 17 2014 16:56:38) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.7.0-dev, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies |
If FPM create’s issue then create a shebang file :
1 | /opt/fpm.sh |
with modified paths matching with your current Nginx config’s UNIX Socket :
1 2 3 | #!/bin/bash PHP_FCGI_CHILDREN=4 PHP_FCGI_MAX_REQUESTS=0 php-cgi -b /path/to/unix/socket |
chmod it rightly and execute it.
If you are desparate to test PHP 7, then do these steps :
1 2 3 | mkdir $HOME/php7 cd $HOME/php7 git clone https://git.php.net/repository/php-src.git |
These are fixes for errors :
1 2 3 4 5 6 7 8 9 10 | sudo apt-get install libt1-dev sudo apt-get install libgmp-dev locate gm.h # this is an example of symlinking ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h # use older version of bison and bison-dev wget http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb wget http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb dpkg -i bison_2.7.1.dfsg-1_amd64.deb |
we have to build :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | cd php-src ./buildconf ./configure \ --prefix=$HOME/php7/usr \ --with-config-file-path=$HOME/php7/usr/etc \ --enable-mbstring \ --enable-zip \ --enable-bcmath \ --enable-pcntl \ --enable-ftp \ --enable-exif \ --enable-calendar \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-wddx \ --with-curl \ --with-mcrypt \ --with-iconv \ --with-gmp \ --with-pspell \ --with-gd \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \ --with-zlib-dir=/usr \ --with-xpm-dir=/usr \ --with-freetype-dir=/usr \ --with-t1lib=/usr \ --enable-gd-native-ttf \ --enable-gd-jis-conv \ --with-openssl \ --with-mysql=/usr \ --with-pdo-mysql=/usr \ --with-gettext=/usr \ --with-zlib=/usr \ --with-bz2=/usr \ --with-recode=/usr \ --with-mysqli=/usr/bin/mysql_config |
Now install :
1 2 | make make install |
You need to create PHP.ini
manually :
1 2 | mkdir $HOME/php7/usr/etc nano $HOME/php7/usr/etc/php.ini |
Actually, more is written here :
1 | https://wiki.php.net/phpng |
There is a PDF file too.
Tagged With compile php with phpng engine , https://thecustomizewindows com/2015/03/phpng-the-faster-next-version-of-php/ , php5 1 2 upgrade