Saturday, January 2, 2016

Install PHP 7 Nightly Built on CentOS 7

Install PHP 7 Nightly Built on CentOS 7

Add a new repository:

# vim /etc/yum.repos.d/php7-nightly.repo

[zend-php7]
name = PHP7 nightly by Zend Technologies
baseurl = http://repos.zend.com/zend-server/early-access/php7/repos/centos/
gpgcheck=0

Note: the default installation path will be: /usr/local/php7

Install PHP 7 from the PHP official development repository:

# yum install php7-nightly

Copy the configuration files:

# cd /usr/local/php7/etc
# cp php-fpm.conf.default php-fpm.conf
# cp php-fpm.d/www.conf.default php-fpm.d/www.conf

# cd ~/tmp
# wget http://ca1.php.net/get/php-7.0.1.tar.xz/from/this/mirror -O php-7.0.1.tar.xz
# tar Jxvf php-7.0.1.tar.xz
# cp ~/tmp/php-7.0.1/php.ini* /usr/local/php7/etc/
# cd /usr/local/php7/etc
# cp php.ini-development php.ini

Edit www.conf:

# vim /usr/local/php7/etc/php-fpm.d/www.conf

user = apache
group = apache

Edit php.ini:

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

zend_extension=opcache.so
opcache.enable=1
opcache.enable_cli=1

Start php-fpm in background:

# /usr/local/php7/sbin/php-fpm -D

# ps auxww|grep php

root     43345  0.0  0.1 421576  7376 ?        Ss   Jan01   0:03 php-fpm: master process (/usr/local/php7/etc/php-fpm.conf)
apache   43346  0.0  1.0 429736 42760 ?        S    Jan01   0:05 php-fpm: pool www
apache   43347  0.0  1.0 429924 42276 ?        S    Jan01   0:07 php-fpm: pool www
apache   44123  0.0  0.9 429388 37168 ?        S    Jan01   0:00 php-fpm: pool www

No comments: