On August 28 the PHP development team released version 5.6 which includes innovative features such as: functions with arguments variable using the operator …, exponentiation operations by making use of the operator **, import functions and constants using the use keyword among others. Today LibreByte will show as compiling php-5.6 with fpm support.
Download PHP 5.6.0
$ wget http://us1.php.net/distributions/php-5.6.0.tar.xz
Unpack PHP 5.6.0
$ tar xJvf php-5.6.0.tar.xz
Download and run the script to install dependencies
$ wget -c --no-check-certificate https://raw.githubusercontent.com/yoander/sysadmin/master/shscript/php-dev-install-dep.sh && chmod a+x -c php-dev-install-dep.sh && ./php-dev-install-dep.sh nginx
Download script to compile php
$ wget -c --no-check-certificate https://raw.githubusercontent.com/yoander/sysadmin/master/shscript/php-build.sh && chmod a+x -c php-build.sh
Compile php with fpm support
$ ./php-build.sh -f php-5.6.0
Install
$ cd php-5.6.0 && sudo make install
Create php configuration file
Development
$ sudo cp -v php.ini-development /etc/php/php.ini
Production
$ sudo cp -v php.ini-production /etc/php/php.ini
Activate OpCache
$ sudo bash -c 'echo "zend_extension=opcache.so" > /etc/php/conf.d/20-opcache.ini'
Create fpm configuration file
$ sudo cp -pv /etc/php/php-fpm.conf.default /etc/php/php-fpm.conf
Create the fpm service startup file
sudo bash -c 'cp -v sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm && chmod a+x -c /etc/init.d/php-fpm'
Start the fpm service
$ sudo service fpm-start
Edit the nginx configuration file
$ sudo vim /etc/nginx/sites-enabled/default
and uncomment the following lines
location ~ .php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php include fastcgi_params; }
Start nginx
sudo service ngnix start
We check
$ firefox http://localhost/info.php
How to compile PHP from the source code, 9 (11)
- How to compile PHP 7.1 in Ubuntu 16.04
- Butterfly Builder, a tool to compile PHP
- How to compile PHP 7.4 on Ubuntu 18.04
- How to compile PHP-7.3 en Debian
- How to compile PHP-7.2 on CentOS
- How to Compile PHP 8.0 in Debian 10?
- Compile php 5.5 with apache prefork support
- Compile PHP-5.6 with Apache Worker support
- Compile php-5.6 with fpm support
- How to compile PHP-5.6 on CentOS 7
- Compile PHP 7 on Debian 8
Hi!
Please make update inside your php-build.sh
in 65 line (in last elase) should be:
SYSCONFIDIR=$PREFIX/etc/php
If someone will try usine scrpt in Centos 6.5 php 5.6.x should make one more change.
MAIN_CONF=”–with-apxs2=$(which apxs)” – instead (which apxs2)
Regards :)
Thanks for your suggestion please could you clone the script and apply the change on: https://github.com/yoander/sysadmin/blob/master/shscript/php-build.sh and do a pull request?
If someone will try usine scrpt in Centos 6.5 php 5.6.x should make one more change.
MAIN_CONF=”–with-apxs2=$(which apxs)” – instead (which apxs2)
Regards :)
Alright, one more fix ;)
At the end of ESSENTIAL_EXT=”… add $ESSENTIAL_EXT”