Selasa, 30 Oktober 2018

How to configure mysql plugins check mk agent

  1 komentar
Before you read the following section, make sure you have install check mk agent and work properly, if yet, you can find the tutorial how to install check mk agent here

Create check_mk user on mysql with select only permission
[email protected]:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 289
Server version: 5.5.60-0+deb7u1 (Debian)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> GRANT SELECT ON *.* to [email protected]'localhost' IDENTIFIED BY '[email protected]';
Query OK, 0 rows affected (0.29 sec)

mysql> exit
Bye
[email protected]:~$

Execute check mk agent and read the text result, find out where is the agent directory and plugins directory
[email protected]:~$ nc -v localhost 6556
Connection to localhost 6556 port [tcp/*] succeeded!
<<<check_mk>>>
Version: 1.5.0p4
AgentOS: linux
Hostname: vta-cloud
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
<<<df>>>
udev           devtmpfs     4059644        0   4059644       0% /dev
tmpfs          tmpfs         815768    50488    765280       7% /run
/dev/sda4      ext4       495251272 85974012 384096896      19% /
tmpfs          tmpfs        4078820       80   4078740       1% /dev/shm
tmpfs          tmpfs           5120        0      5120       0% /run/lock

Create mysq.cfg new file on check mk agent directory with following content, use mysql user and password that created before
[email protected]:~$ sudo vi /etc/check_mk/mysql.cfg
[sudo] password for sysop:
[email protected]:~$
[email protected]:~$ sudo cat /etc/check_mk/mysql.cfg
[client]
user=check_mk
[email protected]
[email protected]:~$
Create mysq.cfg new file on check mk agent directory with following content, use mysql user and password that created before
[email protected]:~$ sudo vi /etc/check_mk/mysql.cfg
[sudo] password for sysop:
[email protected]:~$
[email protected]:~$ sudo cat /etc/check_mk/mysql.cfg
[client]
user=check_mk
[email protected]
[email protected]:~$
Change working directory to check mk agent plugins and download the check mk mysql plugins
[email protected]:~$ cd /usr/lib/check_mk_agent/plugins/
[email protected]:/usr/lib/check_mk_agent/plugins$ ls
[email protected]:/usr/lib/check_mk_agent/plugins$ 
[email protected]:/usr/lib/check_mk_agent/plugins$ sudo wget https://monitoring.wachid.web.id/monitoring/check_mk/agents/plugins/mk_mysql
--2018-10-30 18:21:49--  https://monitoring-wachid.web.id/monitoring/check_mk/agents/plugins/mk_mysql
Connecting to 192.168.71.17:9898... connected.
Proxy request sent, awaiting response... 200 OK
Length: 3518 (3.4K) [text/plain]
Saving to: ‘mk_mysql’

mk_mysql                          100%[===========================================================>]   3.44K  --.-KB/s    in 0s

2018-10-30 18:21:50 (23.6 MB/s) - ‘mk_mysql’ saved [3518/3518]

[email protected]:/usr/lib/check_mk_agent/plugins$ ls
mk_mysql
[email protected]:/usr/lib/check_mk_agent/plugins$
Add execution privileges to the mysql plugins file
[email protected]:/usr/lib/check_mk_agent/plugins$ sudo chmod 775 mk_mysql
[email protected]:/usr/lib/check_mk_agent/plugins$
[email protected]:/usr/lib/check_mk_agent/plugins$ ls -l
total 4
-rwxrwxr-x 1 root root 3518 Sep 11 00:27 mk_mysql
[email protected]:/usr/lib/check_mk_agent/plugins$
Execute the check mk agent by telnet localhost on port 6556 and read out the result, you fill find mysql under the local result text, it's mean the check mk mysql plugins work properly
...
...
<<<local>>>
<<<<>>>>
<<<local>>>
<<<mysql_ping>>>
[[mysql]]
mysqld is alive
<<<mysql>>>
[[mysql]]
Aborted_clients 3
Aborted_connects        16
Binlog_cache_disk_use   0
Binlog_cache_use        0
Binlog_stmt_cache_disk_use      0
Binlog_stmt_cache_use   0
Bytes_received  29721010161
Bytes_sent      186671796
Com_admin_commands      58
Com_assign_to_keycache  0
Com_alter_db    0
Com_alter_db_upgrade    0
Com_alter_event 0
Com_alter_function      0


How to install and configure check mk agent using systemd on ubuntu

  Tidak ada komentar
Download check mk agent installation file
[email protected]:~$ curl -O https://monitoring.wachid.web.id/monitor/check_mk/agents/check-mk-agent_1.5.0p4-1_all.deb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 26162  100 26162    0     0  18122      0  0:00:01  0:00:01 --:--:-- 18130
[email protected]:~$ ls
check-mk-agent_1.5.0p4-1_all.deb                        oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm  wch_backres_vta.sh
junk                                                    oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm  
[email protected]:~$
Add execute permission to check mk agent installation file
[email protected]:~$ chmod +x check-mk-agent_1.5.0p4-1_all.deb
[email protected]:~$ ls
check-mk-agent_1.5.0p4-1_all.deb                        oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm  wch_backres_vta.sh
junk                                                    oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm  vta-vta-backup.2018-10-12_01-30-01.sql
[email protected]:~$ ls -l
total 1996840
-rwxrwxr-x 1 sysop sysop      26162 Oct 30 17:01 check-mk-agent_1.5.0p4-1_all.deb
drwxrwxr-x 2 sysop sysop       4096 Oct 30 15:44 junk
-rw-rw-r-- 1 sysop sysop   62587782 Sep  7 15:58 oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
-rw-rw-r-- 1 sysop sysop     634803 Sep  7 16:25 oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
-rw-rw-r-- 1 sysop sysop   52826628 Sep  7 15:23 oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
-rw-r--r-- 1 sysop sysop 1928659028 Oct 12 08:44 vta-vta-backup.2018-10-12_01-30-01.sql
-rwxr-xr-x 1 sysop sysop       7608 Oct 30 16:22 wch_backres_vta.sh
[email protected]:~$
Install the check mk agent package file



[email protected]:~$ dpkg -i check-mk-agent_1.5.0p4-1_all.deb
dpkg: error: requested operation requires superuser privilege
[email protected]:~$ sudo dpkg -i check-mk-agent_1.5.0p4-1_all.deb
[sudo] password for sysop:
Selecting previously unselected package check-mk-agent.
(Reading database ... 73756 files and directories currently installed.)
Preparing to unpack check-mk-agent_1.5.0p4-1_all.deb ...
Unpacking check-mk-agent (1.5.0p4-1) ...
Setting up check-mk-agent (1.5.0p4-1) ...
Enable Check_MK_Agent in systemd...
Created symlink from /etc/systemd/system/sockets.target.wants/check_mk.socket to /etc/systemd/system/check_mk.socket.
[email protected]:~$
Reload the daemon and enable start and check status of check mk agent service


[email protected]:~$ sudo systemctl daemon-reload
[email protected]:~$ sudo systemctl enable check_mk.socket
[email protected]:~$ sudo systemctl start check_mk.socket
[email protected]:~$ sudo systemctl status check_mk.socket
● check_mk.socket - Check_MK Agent Socket
   Loaded: loaded (/etc/systemd/system/check_mk.socket; enabled; vendor preset: enabled)
   Active: active (listening) since Tue 2018-10-30 17:01:58 WIB; 9min ago
   Listen: [::]:6556 (Stream)
 Accepted: 0; Connected: 0

Oct 30 17:01:58 cloud systemd[1]: Listening on Check_MK Agent Socket.
Oct 30 17:10:55 cloud systemd[1]: Listening on Check_MK Agent Socket.
[email protected]:~$

Check the listen port
[email protected]:~$ netstat -ant | grep 6556
tcp6       0      0 :::6556                 :::*                    LISTEN
[email protected]:~$

Listing the service directory, we can see there are two check mk file (service and socket file) 
[email protected]:~$ ls -l /etc/systemd/system/
total 60
-rw-r--r-- 1 root root  168 Sep 11 02:22 [email protected]
-rw-r--r-- 1 root root  149 Sep 11 02:22 check_mk.socket
drwxr-xr-x 2 root root 4096 Sep  3 18:39 cloud-final.service.wants
drwxr-xr-x 2 root root 4096 Aug 28 15:22 default.target.wants
drwxr-xr-x 2 root root 4096 Oct 30 17:11 docker.service.d
drwxr-xr-x 2 root root 4096 Sep  3 18:39 final.target.wants
drwxr-xr-x 2 root root 4096 Aug 28 15:22 getty.target.wants
drwxr-xr-x 2 root root 4096 Aug 28 16:03 graphical.target.wants
lrwxrwxrwx 1 root root   38 Aug 28 16:03 iscsi.service -> /lib/systemd/system/open-iscsi.service
drwxr-xr-x 2 root root 4096 Oct 30 16:51 multi-user.target.wants
drwxr-xr-x 2 root root 4096 Aug 28 15:22 network-online.target.wants
drwxr-xr-x 2 root root 4096 Aug 28 16:03 paths.target.wants
-rw-r--r-- 1 root root  257 Sep  5 23:44 redis.service
drwxr-xr-x 2 root root 4096 Oct 30 17:01 sockets.target.wants
lrwxrwxrwx 1 root root   31 Aug 28 16:03 sshd.service -> /lib/systemd/system/ssh.service
drwxr-xr-x 2 root root 4096 Aug 28 16:03 sysinit.target.wants
lrwxrwxrwx 1 root root   35 Aug 28 15:22 syslog.service -> /lib/systemd/system/rsyslog.service
drwxr-xr-x 2 root root 4096 Sep  3 19:54 timers.target.wants
[email protected]:~$
The content of check mk systemd service file

[email protected]:~$ sudo cat /etc/systemd/system/[email protected]
# systemd service definition file
[Unit]
Description=Check_MK

[Service]
ExecStart=/usr/bin/check_mk_agent
KillMode=process

User=root
Group=root

StandardInput=socket
[email protected]:~$

The content of check mk systemd socket file
[email protected]:~$ sudo cat /etc/systemd/system/check_mk.socket
# systemd socket definition file
[Unit]
Description=Check_MK Agent Socket

[Socket]
ListenStream=6556
Accept=true

[Install]
WantedBy=sockets.target
[email protected]:~$

Testing the check mk agent service
[email protected]:~$ telnet localhost 6556
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
<<<check_mk>>>
Version: 1.5.0p4
AgentOS: linux
Hostname: vta-cloud
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
<<<df>>>
udev           devtmpfs     4059644        0   4059644       0% /dev
tmpfs          tmpfs         815768    50292    765476       7% /run
/dev/sda4      ext4       495251272 85776392 384294516      19% /
tmpfs          tmpfs        4078820        0   4078820       0% /dev/shm
tmpfs          tmpfs           5120        0      5120       0% /run/lock
tmpfs          tmpfs        4078820        0   4078820       0% /sys/fs/cgroup
..
..
..
Config check mk agent service to use caching 
Check is there check mk caching agent executable file on /usr/bin directory
[email protected]:~$ ls -l /usr/bin/ | grep check
-rwxr-xr-x 1 root   root        6136 Jul 26 09:41 checkgid
-rwxr-xr-x 1 root   root        2771 Jul 29  2016 check-language-support
-rwxr-xr-x 1 root   root       42687 Sep 11 02:22 check_mk_agent
-rwxr-xr-x 1 root   root        4461 Sep 11 02:22 check_mk_caching_agent
-rwxr-xr-x 1 root   root        7503 Mar 15  2018 dpkg-checkbuilddeps
-rwxr-xr-x 1 root   root      254408 Mar 22  2018 grub-script-check
-rwxr-xr-x 1 root   root       14264 Apr 19  2018 innochecksum
-rwxr-xr-x 1 root   root        4090 Apr 25  2018 linux-check-removal
lrwxrwxrwx 1 root   root          10 Apr 19  2018 mysqlanalyze -> mysqlcheck
-rwxr-xr-x 1 root   root     3388504 Apr 19  2018 mysqlcheck
lrwxrwxrwx 1 root   root          10 Apr 19  2018 mysqloptimize -> mysqlcheck
lrwxrwxrwx 1 root   root          10 Apr 19  2018 mysqlrepair -> mysqlcheck
-rwxr-xr-x 1 root   root       19104 Jul 13 20:54 pkcheck
-rwxr-xr-x 1 root   root        3699 Jun 13 02:30 podchecker
-rwxr-xr-x 1 root   root       10232 Dec 20  2015 redis-check-aof
-rwxr-xr-x 1 root   root       22520 Dec 20  2015 redis-check-dump
-rwxr-xr-x 1 root   root       10544 Apr 15  2016 vmware-checkvm
[email protected]:~$
Open the check mk agent systemd service file, and change the check mk execution file from check mk agen to check mk caching agent and restart the service again
[email protected]:~$ sudo vi /etc/systemd/system/[email protected]
[email protected]:~$
[email protected]:~$ sudo systemctl restart check_mk.socket
[email protected]:~$
Here are the file after updated
[email protected]:~$ sudo cat /etc/systemd/system/[email protected]
# systemd service definition file
[Unit]
Description=Check_MK

[Service]
#ExecStart=/usr/bin/check_mk_agent
ExecStart=/usr/bin/check_mk_caching_agent
KillMode=process

User=root
Group=root

StandardInput=socket
[email protected]:~$
Testing the check mk service again by running telnel on localhost port 6556







[email protected]:~$ telnet localhost 6556
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
<<<check_mk>>>
Version: 1.5.0p4
AgentOS: linux
Hostname: vta-cloud
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
<<<df>>>
udev           devtmpfs     4059644        0   4059644       0% /dev
tmpfs          tmpfs         815768    50516    765252       7% /run
/dev/sda4      ext4       495251272 85973928 384096980      19% /
tmpfs          tmpfs        4078820       80   4078740       1% /dev/shm
tmpfs          tmpfs           5120        0      5120       0% /run/lock
tmpfs          tmpfs        4078820        0   4078820       0% /sys/fs/cgroup
/dev/sda1      ext4          474730    57648    388052      13% /boot
/dev/sda5      ext4         4673664  2006592   2406620      46% /home
tmpfs          tmpfs            100        0       100       0% /run/lxcfs/controllers
tmpfs          tmpfs         815768        0    815768       0% /run/user/1000
none           aufs       495251272 85973928 384096980      19% /var/lib/docker/aufs/mnt/8
Testing the check mk service again by running telnel on localhost port 6556
[email protected]:~$ telnet localhost 6556
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
<<<check_mk>>>
Version: 1.5.0p4
AgentOS: linux
Hostname: vta-cloud
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
<<<df>>>
udev           devtmpfs     4059644        0   4059644       0% /dev
tmpfs          tmpfs         815768    50516    765252       7% /run
/dev/sda4      ext4       495251272 85973928 384096980      19% /
tmpfs          tmpfs        4078820       80   4078740       1% /dev/shm
tmpfs          tmpfs           5120        0      5120       0% /run/lock
tmpfs          tmpfs        4078820        0   4078820       0% /sys/fs/cgroup
/dev/sda1      ext4          474730    57648    388052      13% /boot
/dev/sda5      ext4         4673664  2006592   2406620      46% /home
tmpfs          tmpfs            100        0       100       0% /run/lxcfs/controllers
tmpfs          tmpfs         815768        0    815768       0% /run/user/1000
none           aufs       495251272 85973928 384096980      19% /var/lib/docker/aufs/mnt/8
You can also use netcat to testing the check mk agent

[email protected]:~$ nc -v localhost 6556
Connection to localhost 6556 port [tcp/*] succeeded!
<<<check_mk>>>
Version: 1.5.0p4
AgentOS: linux
Hostname: vta-cloud
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
<<<df>>>
udev           devtmpfs     4059644        0   4059644       0% /dev
tmpfs          tmpfs         815768    50488    765280       7% /run
/dev/sda4      ext4       495251272 85974012 384096896      19% /

Configure the firewall

Check firewall status
[email protected]:~$ sudo ufw status numbered
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] 80                         ALLOW IN    Anywhere
[ 2] 80 (v6)                    ALLOW IN    Anywhere (v6)

[email protected]:~$
Add firewall rule to allow check mk agent service (port 6556) and check the status
[email protected]:~$ sudo ufw allow from any to any port 6556
Rule added
Rule added (v6)
[email protected]:~$
[email protected]:~$ sudo ufw status numbered
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] 80                         ALLOW IN    Anywhere
[ 2] 6556                       ALLOW IN    Anywhere
[ 3] 80 (v6)                    ALLOW IN    Anywhere (v6)
[ 4] 6556 (v6)                  ALLOW IN    Anywhere (v6)

[email protected]:~$
Testing check mk agent from another host
[email protected]:~$ nc -v 192.168.71.26 6556
Connection to 192.168.71.26 6556 port [tcp/*] succeeded!
<<<check_mk>>>
Version: 1.5.0p4
AgentOS: linux
Hostname: vta-cloud
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
<<<df>>>
udev           devtmpfs     4059644        0   4059644       0% /dev
tmpfs          tmpfs         815768    50460    765308       7% /run
/dev/sda4      ext4       495251272 86246892 383824016      19% /
tmpfs          tmpfs        4078820       80   4078740       1% /dev/shm
tmpfs          tmpfs           5120        0      5120       0% /run/lock
tmpfs          tmpfs        4078820        0   4078820       0% /sys/fs/cgroup
/dev/sda1      ext4          474730    57648    388052      13% /boot
/dev/sda5      ext4         4673664  2006640   2406572      46% /home
tmpfs          tmpfs            100        0       100       0% /run/lxcfs/controllers
tmpfs          tmpfs         815768        0    815768       0% /run/user/1000

Senin, 29 Oktober 2018

How to install and configure php 5.6.37 from source centos 7

  Tidak ada komentar
Install epel-release repository
[[email protected] ~]# yum install epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.axarva.id
 * epel: mirror.poliwangi.ac.id
 * extras: mirror.axarva.id
 * ius: ftp.acc.umu.se
 * remi-safe: rpms.remirepo.net
 * updates: mirror.axarva.id
Package epel-release-7-11.noarch already installed and latest version
Nothing to do
[[email protected] ~]#
Install some needed library
[[email protected] ~]# sudo yum install autoconf libtool re2c bison libxml2-devel bzip2-devel libcurl-devel libpng-devel libicu-devel gcc-c++ libmcrypt-devel libwebp-devel libjpeg-devel openssl-devel -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.axarva.id
 * epel: mirror.poliwangi.ac.id
 * extras: mirror.axarva.id
 * ius: mirrors.ircam.fr
 * remi-safe: mirror.xeonbd.com
 * updates: mirror.axarva.id
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch 0:2.69-11.el7 will be installed
--> Processing Dependency: m4 >= 1.4.14 for package: autoconf-2.69-11.el7.noarch
--> Processing Dependency: perl(Data::Dumper) for package: autoconf-2.69-11.el7.noarch
---> Package bison.x86_64 0:3.0.4-1.el7 will be installed
---> Package bzip2-devel.x86_64 0:1.0.6-13.el7 will be installed
---> Package gcc-c++.x86_64 0:4.8.5-28.el7_5.1 will be installed
--> Processing Dependency: libstdc++-devel = 4.8.5-28.el7_5.1 for package: gcc-c++-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: gcc = 4.8.5-28.el7_5.1 for package: gcc-c++-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-c++-4.8.5-28.el7_5.1.x86_64
---> Package libcurl-devel.x86_64 0:7.29.0-46.el7 will be installed
epel/x86_64/filelists                                                                                          |  10 MB  00:00:00
base/7/x86_64/filelists_db                                                                                     | 6.9 MB  00:00:00
updates/7/x86_64/filelists_db                                                                                  | 3.4 MB  00:00:00
---> Package libicu-devel.x86_64 0:50.1.2-15.el7 will be installed
---> Package libjpeg-turbo-devel.x86_64 0:1.2.90-5.el7 will be installed
---> Package libmcrypt-devel.x86_64 0:2.5.8-13.el7 will be installed
--> Processing Dependency: libmcrypt = 2.5.8-13.el7 for package: libmcrypt-devel-2.5.8-13.el7.x86_64
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: libmcrypt-devel-2.5.8-13.el7.x86_64
---> Package libpng-devel.x86_64 2:1.5.13-7.el7_2 will be installed
--> Processing Dependency: zlib-devel(x86-64) for package: 2:libpng-devel-1.5.13-7.el7_2.x86_64
---> Package libtool.x86_64 0:2.4.2-22.el7_3 will be installed
--> Processing Dependency: automake for package: libtool-2.4.2-22.el7_3.x86_64
---> Package libwebp-devel.x86_64 0:0.3.0-7.el7 will be installed
---> Package libxml2-devel.x86_64 0:2.9.1-6.el7_2.3 will be installed
--> Processing Dependency: xz-devel for package: libxml2-devel-2.9.1-6.el7_2.3.x86_64
---> Package openssl-devel.x86_64 1:1.0.2k-12.el7 will be installed
--> Processing Dependency: krb5-devel(x86-64) for package: 1:openssl-devel-1.0.2k-12.el7.x86_64
---> Package re2c.x86_64 0:0.14.3-2.el7 will be installed
--> Running transaction check
---> Package automake.noarch 0:1.13.4-3.el7 will be installed
--> Processing Dependency: perl(Thread::Queue) for package: automake-1.13.4-3.el7.noarch
--> Processing Dependency: perl(TAP::Parser) for package: automake-1.13.4-3.el7.noarch
---> Package gcc.x86_64 0:4.8.5-28.el7_5.1 will be installed
--> Processing Dependency: cpp = 4.8.5-28.el7_5.1 for package: gcc-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-28.el7_5.1.x86_64
---> Package krb5-devel.x86_64 0:1.15.1-19.el7 will be installed
--> Processing Dependency: libkadm5(x86-64) = 1.15.1-19.el7 for package: krb5-devel-1.15.1-19.el7.x86_64
--> Processing Dependency: libverto-devel for package: krb5-devel-1.15.1-19.el7.x86_64
--> Processing Dependency: libselinux-devel for package: krb5-devel-1.15.1-19.el7.x86_64
--> Processing Dependency: libcom_err-devel for package: krb5-devel-1.15.1-19.el7.x86_64
--> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.15.1-19.el7.x86_64
---> Package libmcrypt.x86_64 0:2.5.8-13.el7 will be installed
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package libstdc++-devel.x86_64 0:4.8.5-28.el7_5.1 will be installed
---> Package m4.x86_64 0:1.4.16-10.el7 will be installed
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
---> Package xz-devel.x86_64 0:5.2.2-1.el7 will be installed
---> Package zlib-devel.x86_64 0:1.2.7-17.el7 will be installed
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-28.el7_5.1 will be installed
---> Package glibc-devel.x86_64 0:2.17-222.el7 will be installed
--> Processing Dependency: glibc-headers = 2.17-222.el7 for package: glibc-devel-2.17-222.el7.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-222.el7.x86_64
---> Package keyutils-libs-devel.x86_64 0:1.5.8-3.el7 will be installed
---> Package libcom_err-devel.x86_64 0:1.42.9-12.el7_5 will be installed
---> Package libkadm5.x86_64 0:1.15.1-19.el7 will be installed
---> Package libselinux-devel.x86_64 0:2.5-12.el7 will be installed
--> Processing Dependency: libsepol-devel(x86-64) >= 2.5-6 for package: libselinux-devel-2.5-12.el7.x86_64
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.5-12.el7.x86_64
--> Processing Dependency: pkgconfig(libpcre) for package: libselinux-devel-2.5-12.el7.x86_64
---> Package libverto-devel.x86_64 0:0.2.5-4.el7 will be installed
---> Package perl-Test-Harness.noarch 0:3.28-3.el7 will be installed
---> Package perl-Thread-Queue.noarch 0:3.02-2.el7 will be installed
--> Running transaction check
---> Package glibc-headers.x86_64 0:2.17-222.el7 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-222.el7.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-222.el7.x86_64
---> Package libsepol-devel.x86_64 0:2.5-8.1.el7 will be installed
---> Package pcre-devel.x86_64 0:8.32-17.el7 will be installed
--> Running transaction check
---> Package kernel-headers.x86_64 0:3.10.0-862.14.4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                               Arch                     Version                               Repository                 Size
======================================================================================================================================
Installing:
 autoconf                              noarch                   2.69-11.el7                           base                      701 k
 bison                                 x86_64                   3.0.4-1.el7                           base                      674 k
 bzip2-devel                           x86_64                   1.0.6-13.el7                          base                      218 k
 gcc-c++                               x86_64                   4.8.5-28.el7_5.1                      updates                   7.2 M
 libcurl-devel                         x86_64                   7.29.0-46.el7                         base                      300 k
 libicu-devel                          x86_64                   50.1.2-15.el7                         base                      702 k
 libjpeg-turbo-devel                   x86_64                   1.2.90-5.el7                          base                       98 k
 libmcrypt-devel                       x86_64                   2.5.8-13.el7                          epel                       13 k
 libpng-devel                          x86_64                   2:1.5.13-7.el7_2                      base                      122 k
 libtool                               x86_64                   2.4.2-22.el7_3                        base                      588 k
 libwebp-devel                         x86_64                   0.3.0-7.el7                           base                       23 k
 libxml2-devel                         x86_64                   2.9.1-6.el7_2.3                       base                      1.0 M
 openssl-devel                         x86_64                   1:1.0.2k-12.el7                       base                      1.5 M
 re2c                                  x86_64                   0.14.3-2.el7                          epel                      230 k
Installing for dependencies:
 automake                              noarch                   1.13.4-3.el7                          base                      679 k
 cpp                                   x86_64                   4.8.5-28.el7_5.1                      updates                   5.9 M
 gcc                                   x86_64                   4.8.5-28.el7_5.1                      updates                    16 M
 glibc-devel                           x86_64                   2.17-222.el7                          base                      1.1 M
 glibc-headers                         x86_64                   2.17-222.el7                          base                      678 k
 kernel-headers                        x86_64                   3.10.0-862.14.4.el7                   updates                   7.1 M
 keyutils-libs-devel                   x86_64                   1.5.8-3.el7                           base                       37 k
 krb5-devel                            x86_64                   1.15.1-19.el7                         updates                   269 k
 libcom_err-devel                      x86_64                   1.42.9-12.el7_5                       updates                    31 k
 libkadm5                              x86_64                   1.15.1-19.el7                         updates                   175 k
 libmcrypt                             x86_64                   2.5.8-13.el7                          epel                       99 k
 libmpc                                x86_64                   1.0.1-3.el7                           base                       51 k
 libselinux-devel                      x86_64                   2.5-12.el7                            base                      186 k
 libsepol-devel                        x86_64                   2.5-8.1.el7                           base                       77 k
 libstdc++-devel                       x86_64                   4.8.5-28.el7_5.1                      updates                   1.5 M
 libverto-devel                        x86_64                   0.2.5-4.el7                           base                       12 k
 m4                                    x86_64                   1.4.16-10.el7                         base                      256 k
 pcre-devel                            x86_64                   8.32-17.el7                           base                      480 k
 perl-Data-Dumper                      x86_64                   2.145-3.el7                           base                       47 k
 perl-Test-Harness                     noarch                   3.28-3.el7                            base                      302 k
 perl-Thread-Queue                     noarch                   3.02-2.el7                            base                       17 k
 xz-devel                              x86_64                   5.2.2-1.el7                           base                       46 k
 zlib-devel                            x86_64                   1.2.7-17.el7                          base                       50 k

Transaction Summary
======================================================================================================================================
Install  14 Packages (+23 Dependent packages)

Total download size: 49 M
Installed size: 114 M
Downloading packages:
(1/37): autoconf-2.69-11.el7.noarch.rpm                                                                        | 701 kB  00:00:00
(2/37): automake-1.13.4-3.el7.noarch.rpm                                                                       | 679 kB  00:00:00
(3/37): bzip2-devel-1.0.6-13.el7.x86_64.rpm                                                                    | 218 kB  00:00:00
(4/37): bison-3.0.4-1.el7.x86_64.rpm                                                                           | 674 kB  00:00:00
(5/37): cpp-4.8.5-28.el7_5.1.x86_64.rpm                                                                        | 5.9 MB  00:00:01
(6/37): glibc-headers-2.17-222.el7.x86_64.rpm                                                                  | 678 kB  00:00:00
(7/37): glibc-devel-2.17-222.el7.x86_64.rpm                                                                    | 1.1 MB  00:00:00
(8/37): gcc-c++-4.8.5-28.el7_5.1.x86_64.rpm                                                                    | 7.2 MB  00:00:01
(9/37): keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm                                                             |  37 kB  00:00:00
(10/37): gcc-4.8.5-28.el7_5.1.x86_64.rpm                                                                       |  16 MB  00:00:03
(11/37): krb5-devel-1.15.1-19.el7.x86_64.rpm                                                                   | 269 kB  00:00:00
(12/37): libcom_err-devel-1.42.9-12.el7_5.x86_64.rpm                                                           |  31 kB  00:00:00
(13/37): kernel-headers-3.10.0-862.14.4.el7.x86_64.rpm                                                         | 7.1 MB  00:00:01
(14/37): libcurl-devel-7.29.0-46.el7.x86_64.rpm                                                                | 300 kB  00:00:00
(15/37): libicu-devel-50.1.2-15.el7.x86_64.rpm                                                                 | 702 kB  00:00:00
(16/37): libjpeg-turbo-devel-1.2.90-5.el7.x86_64.rpm                                                           |  98 kB  00:00:00
(17/37): libkadm5-1.15.1-19.el7.x86_64.rpm                                                                     | 175 kB  00:00:00
(18/37): libmcrypt-2.5.8-13.el7.x86_64.rpm                                                                     |  99 kB  00:00:00
(19/37): libmpc-1.0.1-3.el7.x86_64.rpm                                                                         |  51 kB  00:00:00
(20/37): libselinux-devel-2.5-12.el7.x86_64.rpm                                                                | 186 kB  00:00:00
(21/37): libsepol-devel-2.5-8.1.el7.x86_64.rpm                                                                 |  77 kB  00:00:00
(22/37): libtool-2.4.2-22.el7_3.x86_64.rpm                                                                     | 588 kB  00:00:00
(23/37): libverto-devel-0.2.5-4.el7.x86_64.rpm                                                                 |  12 kB  00:00:00
(24/37): libwebp-devel-0.3.0-7.el7.x86_64.rpm                                                                  |  23 kB  00:00:00
(25/37): libmcrypt-devel-2.5.8-13.el7.x86_64.rpm                                                               |  13 kB  00:00:00
(26/37): libxml2-devel-2.9.1-6.el7_2.3.x86_64.rpm                                                              | 1.0 MB  00:00:00
(27/37): libstdc++-devel-4.8.5-28.el7_5.1.x86_64.rpm                                                           | 1.5 MB  00:00:00
(28/37): m4-1.4.16-10.el7.x86_64.rpm                                                                           | 256 kB  00:00:00
(29/37): libpng-devel-1.5.13-7.el7_2.x86_64.rpm                                                                | 122 kB  00:00:00
(30/37): openssl-devel-1.0.2k-12.el7.x86_64.rpm                                                                | 1.5 MB  00:00:00
(31/37): perl-Data-Dumper-2.145-3.el7.x86_64.rpm                                                               |  47 kB  00:00:00
(32/37): pcre-devel-8.32-17.el7.x86_64.rpm                                                                     | 480 kB  00:00:00
(33/37): perl-Test-Harness-3.28-3.el7.noarch.rpm                                                               | 302 kB  00:00:00
(34/37): perl-Thread-Queue-3.02-2.el7.noarch.rpm                                                               |  17 kB  00:00:00
(35/37): xz-devel-5.2.2-1.el7.x86_64.rpm                                                                       |  46 kB  00:00:00
(36/37): zlib-devel-1.2.7-17.el7.x86_64.rpm                                                                    |  50 kB  00:00:00
(37/37): re2c-0.14.3-2.el7.x86_64.rpm                                                                          | 230 kB  00:00:00
--------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                 9.4 MB/s |  49 MB  00:00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libmpc-1.0.1-3.el7.x86_64                                                                                         1/37
  Installing : zlib-devel-1.2.7-17.el7.x86_64                                                                                    2/37
  Installing : m4-1.4.16-10.el7.x86_64                                                                                           3/37
  Installing : cpp-4.8.5-28.el7_5.1.x86_64                                                                                       4/37
  Installing : libkadm5-1.15.1-19.el7.x86_64                                                                                     5/37
  Installing : libsepol-devel-2.5-8.1.el7.x86_64                                                                                 6/37
  Installing : xz-devel-5.2.2-1.el7.x86_64                                                                                       7/37
  Installing : kernel-headers-3.10.0-862.14.4.el7.x86_64                                                                         8/37
  Installing : glibc-headers-2.17-222.el7.x86_64                                                                                 9/37
  Installing : glibc-devel-2.17-222.el7.x86_64                                                                                  10/37
  Installing : gcc-4.8.5-28.el7_5.1.x86_64                                                                                      11/37
  Installing : perl-Data-Dumper-2.145-3.el7.x86_64                                                                              12/37
  Installing : autoconf-2.69-11.el7.noarch                                                                                      13/37
  Installing : libcom_err-devel-1.42.9-12.el7_5.x86_64                                                                          14/37
  Installing : perl-Thread-Queue-3.02-2.el7.noarch                                                                              15/37
  Installing : perl-Test-Harness-3.28-3.el7.noarch                                                                              16/37
  Installing : automake-1.13.4-3.el7.noarch                                                                                     17/37
  Installing : libstdc++-devel-4.8.5-28.el7_5.1.x86_64                                                                          18/37
  Installing : libverto-devel-0.2.5-4.el7.x86_64                                                                                19/37
  Installing : keyutils-libs-devel-1.5.8-3.el7.x86_64                                                                           20/37
  Installing : libmcrypt-2.5.8-13.el7.x86_64                                                                                    21/37
  Installing : pcre-devel-8.32-17.el7.x86_64                                                                                    22/37
  Installing : libselinux-devel-2.5-12.el7.x86_64                                                                               23/37
  Installing : krb5-devel-1.15.1-19.el7.x86_64                                                                                  24/37
  Installing : 1:openssl-devel-1.0.2k-12.el7.x86_64                                                                             25/37
  Installing : libmcrypt-devel-2.5.8-13.el7.x86_64                                                                              26/37
  Installing : gcc-c++-4.8.5-28.el7_5.1.x86_64                                                                                  27/37
  Installing : libtool-2.4.2-22.el7_3.x86_64                                                                                    28/37
  Installing : libxml2-devel-2.9.1-6.el7_2.3.x86_64                                                                             29/37
  Installing : bison-3.0.4-1.el7.x86_64                                                                                         30/37
  Installing : 2:libpng-devel-1.5.13-7.el7_2.x86_64                                                                             31/37
  Installing : libicu-devel-50.1.2-15.el7.x86_64                                                                                32/37
  Installing : libcurl-devel-7.29.0-46.el7.x86_64                                                                               33/37
  Installing : libjpeg-turbo-devel-1.2.90-5.el7.x86_64                                                                          34/37
  Installing : libwebp-devel-0.3.0-7.el7.x86_64                                                                                 35/37
  Installing : bzip2-devel-1.0.6-13.el7.x86_64                                                                                  36/37
  Installing : re2c-0.14.3-2.el7.x86_64                                                                                         37/37
  Verifying  : krb5-devel-1.15.1-19.el7.x86_64                                                                                   1/37
  Verifying  : zlib-devel-1.2.7-17.el7.x86_64                                                                                    2/37
  Verifying  : libxml2-devel-2.9.1-6.el7_2.3.x86_64                                                                              3/37
  Verifying  : automake-1.13.4-3.el7.noarch                                                                                      4/37
  Verifying  : glibc-devel-2.17-222.el7.x86_64                                                                                   5/37
  Verifying  : pcre-devel-8.32-17.el7.x86_64                                                                                     6/37
  Verifying  : glibc-headers-2.17-222.el7.x86_64                                                                                 7/37
  Verifying  : re2c-0.14.3-2.el7.x86_64                                                                                          8/37
  Verifying  : libmcrypt-devel-2.5.8-13.el7.x86_64                                                                               9/37
  Verifying  : m4-1.4.16-10.el7.x86_64                                                                                          10/37
  Verifying  : libmcrypt-2.5.8-13.el7.x86_64                                                                                    11/37
  Verifying  : keyutils-libs-devel-1.5.8-3.el7.x86_64                                                                           12/37
  Verifying  : bzip2-devel-1.0.6-13.el7.x86_64                                                                                  13/37
  Verifying  : libwebp-devel-0.3.0-7.el7.x86_64                                                                                 14/37
  Verifying  : 1:openssl-devel-1.0.2k-12.el7.x86_64                                                                             15/37
  Verifying  : libverto-devel-0.2.5-4.el7.x86_64                                                                                16/37
  Verifying  : libjpeg-turbo-devel-1.2.90-5.el7.x86_64                                                                          17/37
  Verifying  : libselinux-devel-2.5-12.el7.x86_64                                                                               18/37
  Verifying  : libstdc++-devel-4.8.5-28.el7_5.1.x86_64                                                                          19/37
  Verifying  : perl-Test-Harness-3.28-3.el7.noarch                                                                              20/37
  Verifying  : gcc-4.8.5-28.el7_5.1.x86_64                                                                                      21/37
  Verifying  : perl-Thread-Queue-3.02-2.el7.noarch                                                                              22/37
  Verifying  : libcurl-devel-7.29.0-46.el7.x86_64                                                                               23/37
  Verifying  : libcom_err-devel-1.42.9-12.el7_5.x86_64                                                                          24/37
  Verifying  : libtool-2.4.2-22.el7_3.x86_64                                                                                    25/37
  Verifying  : 2:libpng-devel-1.5.13-7.el7_2.x86_64                                                                             26/37
  Verifying  : perl-Data-Dumper-2.145-3.el7.x86_64                                                                              27/37
  Verifying  : bison-3.0.4-1.el7.x86_64                                                                                         28/37
  Verifying  : cpp-4.8.5-28.el7_5.1.x86_64                                                                                      29/37
  Verifying  : libmpc-1.0.1-3.el7.x86_64                                                                                        30/37
  Verifying  : kernel-headers-3.10.0-862.14.4.el7.x86_64                                                                        31/37
  Verifying  : gcc-c++-4.8.5-28.el7_5.1.x86_64                                                                                  32/37
  Verifying  : xz-devel-5.2.2-1.el7.x86_64                                                                                      33/37
  Verifying  : autoconf-2.69-11.el7.noarch                                                                                      34/37
  Verifying  : libicu-devel-50.1.2-15.el7.x86_64                                                                                35/37
  Verifying  : libsepol-devel-2.5-8.1.el7.x86_64                                                                                36/37
  Verifying  : libkadm5-1.15.1-19.el7.x86_64                                                                                    37/37

Installed:
  autoconf.noarch 0:2.69-11.el7                 bison.x86_64 0:3.0.4-1.el7                bzip2-devel.x86_64 0:1.0.6-13.el7
  gcc-c++.x86_64 0:4.8.5-28.el7_5.1             libcurl-devel.x86_64 0:7.29.0-46.el7      libicu-devel.x86_64 0:50.1.2-15.el7
  libjpeg-turbo-devel.x86_64 0:1.2.90-5.el7     libmcrypt-devel.x86_64 0:2.5.8-13.el7     libpng-devel.x86_64 2:1.5.13-7.el7_2
  libtool.x86_64 0:2.4.2-22.el7_3               libwebp-devel.x86_64 0:0.3.0-7.el7        libxml2-devel.x86_64 0:2.9.1-6.el7_2.3
  openssl-devel.x86_64 1:1.0.2k-12.el7          re2c.x86_64 0:0.14.3-2.el7

Dependency Installed:
  automake.noarch 0:1.13.4-3.el7              cpp.x86_64 0:4.8.5-28.el7_5.1            gcc.x86_64 0:4.8.5-28.el7_5.1
  glibc-devel.x86_64 0:2.17-222.el7           glibc-headers.x86_64 0:2.17-222.el7      kernel-headers.x86_64 0:3.10.0-862.14.4.el7
  keyutils-libs-devel.x86_64 0:1.5.8-3.el7    krb5-devel.x86_64 0:1.15.1-19.el7        libcom_err-devel.x86_64 0:1.42.9-12.el7_5
  libkadm5.x86_64 0:1.15.1-19.el7             libmcrypt.x86_64 0:2.5.8-13.el7          libmpc.x86_64 0:1.0.1-3.el7
  libselinux-devel.x86_64 0:2.5-12.el7        libsepol-devel.x86_64 0:2.5-8.1.el7      libstdc++-devel.x86_64 0:4.8.5-28.el7_5.1
  libverto-devel.x86_64 0:0.2.5-4.el7         m4.x86_64 0:1.4.16-10.el7                pcre-devel.x86_64 0:8.32-17.el7
  perl-Data-Dumper.x86_64 0:2.145-3.el7       perl-Test-Harness.noarch 0:3.28-3.el7    perl-Thread-Queue.noarch 0:3.02-2.el7
  xz-devel.x86_64 0:5.2.2-1.el7               zlib-devel.x86_64 0:1.2.7-17.el7

Complete!
[[email protected] ~]#
[[email protected] ~]#
Download php from official website
[[email protected] ~]# wget http://id1.php.net/distributions/php-5.6.37.tar.gz
--2018-10-30 08:45:47--  http://id1.php.net/distributions/php-5.6.37.tar.gz
Resolving id1.php.net (id1.php.net)... 202.182.182.181
Connecting to id1.php.net (id1.php.net)|202.182.182.181|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 19300783 (18M) [application/x-gzip]
Saving to: ‘php-5.6.37.tar.gz’

100%[============================================================================================>] 19,300,783  9.79MB/s   in 1.9s

2018-10-30 08:45:49 (9.79 MB/s) - ‘php-5.6.37.tar.gz’ saved [19300783/19300783]

[[email protected] ~]# ls
anaconda-ks.cfg  php-5.6.27  php-5.6.27.tar.gz  php-5.6.37.tar.gz
[[email protected] ~]#
Extract php source
[[email protected] ~]# tar -zxf php-5.6.37.tar.gz
[[email protected] ~]# ls
anaconda-ks.cfg  php-5.6.27  php-5.6.27.tar.gz  php-5.6.37  php-5.6.37.tar.gz
[[email protected] ~]#
Change working directory to php extracted folder
[[email protected] ~]# cd php-5.6.37/
[[email protected] php-5.6.37]# ls
acinclude.m4      generated_lists  mkinstalldirs             README.NEW-OUTPUT-API             server-tests-config.php
aclocal.m4        genfiles         netware                   README.PARAMETER_PARSING_API      server-tests.php
build             header           NEWS                      README.REDIST.BINS                snapshot
buildconf         INSTALL          pear                      README.RELEASE_PROCESS            stamp-h.in
buildconf.bat     install-sh       php5.spec.in              README.SELF-CONTAINED-EXTENSIONS  stub.c
CODING_STANDARDS  LICENSE          php.gif                   README.STREAMS                    tests
config.guess      ltmain.sh        php.ini-development       README.SUBMITTING_PATCH           travis
config.sub        main             php.ini-production        README.TESTING                    TSRM
configure         makedist         README.EXT_SKEL           README.TESTING2                   UPGRADING
configure.in      Makefile.frag    README.GIT-RULES          README.UNIX-BUILD-SYSTEM          UPGRADING.INTERNALS
CREDITS           Makefile.gcov    README.input_filter       README.WIN32-BUILD-SYSTEM         vcsclean
ext               Makefile.global  README.MAILINGLIST_RULES  run-tests.php                     win32
EXTENSIONS        makerpm          README.md                 sapi                              Zend
footer            missing          README.namespaces         scripts
[[email protected] php-5.6.37]#

Execute Configure help to show the configure option and documentation
[[email protected] php-5.6.37]# ./buildconf --force
Forcing buildconf
Removing configure caches
buildconf: checking installation...
buildconf: autoconf version 2.69 (ok)
[[email protected] php-5.6.37]#
PHP Configuration

You can find more option of configure by typing ./configure help
[[email protected] php-5.6.37]# ./configure --help
`configure' configures this package to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
...
Configure the php
[[email protected] php-5.6.37]# ./buildconf --force
Forcing buildconf
Removing configure caches
buildconf: checking installation...
buildconf: autoconf version 2.69 (ok)
[[email protected] php-5.6.37]#
If you install httpd with yum, don't forget to install httpd devel first

https://www.wachid.web.id/2019/08/how-to-install-apxs2-with-httpd-devel.html

PHP Configuration
[[email protected] php-5.6.37]# ./configure --prefix=/usr/local/php5  --with-config-file-path=/usr/local/php5/etc --with-config-file-scan-dir=/usr/local/php5/etc/conf.d --disable-short-tags --with-openssl --with-pcre-regex --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-exif --with-gd --enable-intl --enable-mbstring  --with-mcrypt --with-mysqli --enable-pcntl --with-pdo-mysql --enable-soap --enable-sockets --with-xmlrpc --enable-zip --with-jpeg-dir --with-png-dir --with-apxs2
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... 
..
..
Thank you for using PHP.

config.status: creating php5.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/cgi/php-cgi.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: executing default commands
[[email protected] php-5.6.37]#
Make the php

[[email protected] php-5.6.37]# make
/bin/sh /root/php-5.6.37/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/date/lib -D HAVE_TIMELIB_CONFIG_H=1 -Iext/date/ -I/root/php-5.6.37/ext/date/ -DPHP_ATOM_INC -I/root/php-5.6.37/include -I/root/php-5.6.37/main -I/root/php-5.6.37 -I/root/php-5.6.37/ext/date/lib -I/root/php-5.6.37/ext/ereg/regex -I/usr/include/libxml2 -I/root/php-5.6.37/ext/mbstring/oniguruma -I/root/php-5.6.37/ext/mbstring/libmbfl -I/root/php-5.6.37/ext/mbstring/libmbfl/mbfl -I/root/php-5.6.37/ext/sqlite3/libsqlite -I/root/php-5.6.37/ext/zip/lib -I/root/php-5.6.37/TSRM -I/root/php-5.6.37/Zend    -I/usr/include -g -O2 -fvisibility=hidden  -c /root/php-5.6.37/ext/date/php_date.c -o ext/date/php_date.lo
/bin/sh /root/php-5.6.37/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/date/lib -D HAVE_TIMELIB_CONFIG_H=1 -Iext/date/ -I/root/php-5.6.37/ext/date/ -DPHP_ATOM_INC -I/root/php-5.6.37/include -I/root/php-5.6.37/main -I/root/php-5.6.37 -I/root/php-5.6.37/ext/date/lib -I/root/php-5.6.37/ext/ereg/regex -I/usr/include/libxml2 -I/root/php-5.6.37/ext/mbstring/oniguruma -I/root/php-5.6.37/ext/mbstring/libmbfl -I/root/php-5.6.37/ext/mbstring/libmbfl/mbfl -I/root/php-5.6.37/ext/sqlite3/libsqlite -I/root/php-5.6.37/ext/zip/lib -I/root/php-5.6.37/TSRM -I/root/php-5.6.37/Zend    -I/usr/include -g -O2 -fvisibility=hidden  -c /root/php-5.6.37/ext/date/lib/astro.c -o ext/date/lib/astro.lo
/bin/sh /root/php-5.6.37/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/date/lib -D HAVE_TIMELIB_CONFIG_H=1 -Iext/date/ -I/root/php-5.6.37/ext/date/ -DPHP_ATOM_INC -I/root/php-5.6.37/include -I/root/php-5.6.37/main -I/root/php-5.6.37 -I/root/php-5.6.37/ext/date/lib -I/root/php-5.6.37/ext/ereg/regex -I/usr/include/libxml2 -I/root/php-5.6.37/ext/mbstring/oniguruma -I/root/php-5.6.37/ext/mbstring/libmbfl -I/root/php-5.6.37/ext/mbstring/libmbfl/mbfl -I/root/php-5.6.37/ext/sqlite3/libsqlite -I/root/php-5.6.37/ext/zip/lib -I/root/php-5.6.37/TSRM -I/root/php-5.6.37/Zend    -I/usr/include -g -O2 -fvisibility=hidden  -c /root/php-5.6.37/ext/date/lib/dow.c -o ext/date/lib/dow.lo
/bin/sh /root/php-5.6.37/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/date/lib -D HAVE_TIMELIB_CONFIG_H=1 -Iext/date/ -I/root/php-5.6.37/ext/date/ -DPHP_ATOM_INC -I/root/php-5.6.37/include -I/root/php-5.6.37/main -I/root/php-5.6.37 -I/root/php-5.6.37/ext/date/lib -I/root/php-5.6.37/ext/ereg/regex -I/usr/include/libxml2 -I/root/php-5.6.37/ext/mbstring/oniguruma -I/root/php-5.6.37/ext/mbstring/libmbfl -I/root/php-5.6.37/ext/mbstring/libmbfl/mbfl -I/root/php-5.6.37/ext/sqlite3/libsqlite -I/root/php-5.6.37/ext/zip/lib -I/root/php-5.6.37/TSRM -I/root/php-5.6.37/Zend    -I/usr/include -g -O2 -fvisibility=hidden  -c /root/php-5.6.37/ext/date/lib/parse_date.c -o ext/date/lib/parse_da
..
..
 -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lssl -lcrypto -lcrypt  -o sapi/cgi/php-cgi
Generating phar.php
Generating phar.phar
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
invertedregexiterator.inc
directorygraphiterator.inc
clicommand.inc
directorytreeiterator.inc
pharcommand.inc
phar.inc

Build complete.
Don't forget to run 'make test'.

[[email protected] php-5.6.37]#
Make install the php
[[email protected] php-5.6.37]# make install
Installing PHP SAPI module:       apache2handler
/usr/lib64/httpd/build/instdso.sh SH_LIBTOOL='/usr/lib64/apr-1/build/libtool' libphp5.la /usr/lib64/httpd/modules
/usr/lib64/apr-1/build/libtool --mode=install install libphp5.la /usr/lib64/httpd/modules/
libtool: install: install .libs/libphp5.so /usr/lib64/httpd/modules/libphp5.so
libtool: install: install .libs/libphp5.lai /usr/lib64/httpd/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /root/php-5.6.37/libs'
chmod 755 /usr/lib64/httpd/modules/libphp5.so
[activating module `php5' in /etc/httpd/conf/httpd.conf]
Installing shared extensions:     /usr/local/php5/lib/php/extensions/no-debug-non-zts-20131226/
Installing PHP CLI binary:        /usr/local/php5/bin/
Installing PHP CLI man page:      /usr/local/php5/php/man/man1/
Installing PHP CGI binary:        /usr/local/php5/bin/
Installing PHP CGI man page:      /usr/local/php5/php/man/man1/
Installing build environment:     /usr/local/php5/lib/php/build/
Installing header files:           /usr/local/php5/include/php/
Installing helper programs:       /usr/local/php5/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/php5/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/php5/lib/php/
[PEAR] Archive_Tar    - installed: 1.4.3
[PEAR] Console_Getopt - installed: 1.4.1
[PEAR] Structures_Graph- installed: 1.1.1
[PEAR] XML_Util       - installed: 1.4.2
[PEAR] PEAR           - installed: 1.10.5
Wrote PEAR system config file at: /usr/local/php5/etc/pear.conf
You may want to add: /usr/local/php5/lib/php to your php.ini include_path
/root/php-5.6.37/build/shtool install -c ext/phar/phar.phar /usr/local/php5/bin
ln -s -f phar.phar /usr/local/php5/bin/phar
Installing PDO headers:           /usr/local/php5/include/php/ext/pdo/
[[email protected] php-5.6.37]#

PHP Configuration

Symlink the php executable file to sbin
[[email protected] php-5.6.37]# php -v
bash: php: command not found...
[[email protected] php-5.6.37]#
[[email protected] php-5.6.37]# ln -s /usr/local/php5/bin/php /sbin/php
[[email protected] php-5.6.37]# php -v
PHP 5.6.27 (cli) (built: Oct 30 2018 06:31:17)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
[[email protected] php-5.6.37]#
Find php ini configuration path and configuration folder
[[email protected] php-5.6.37]# php -i | grep "Configuration File"
Configuration File (php.ini) Path => /usr/local/php5/etc
Loaded Configuration File => (none)
[[email protected] php-5.6.37]# php -i | grep "Scan this"
Scan this dir for additional .ini files => /usr/local/php5/etc/conf.d
[[email protected] php-5.6.37]#

Copy php.ini template to configuration folder, and simlink the file to /etc folder 
[[email protected] php-5.6.37]# cp php.ini-production /usr/local/php5/etc/php.ini
[[email protected] php-5.6.37]# ls -l /usr/local/php5/etc/php.ini
-rw-r--r-- 1 root root 72819 Oct 30 06:39 /usr/local/php5/etc/php.ini
[[email protected] php-5.6.37]# ln -s /usr/local/php5/etc/php.ini /etc/php.ini
[[email protected] php-5.6.37]# ls -l /etc/php.ini
lrwxrwxrwx 1 root root 37 Oct 30 06:40 /etc/php.ini -> /usr/local/php5/etc/php.ini
[[email protected] php-5.6.37]#
Check the php version
[[email protected] php-5.6.37]# php -v
PHP 5.6.37 (cli) (built: Oct 30 2018 08:58:08)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
[[email protected] php-5.6.37]#
Check the php modules
[[email protected] php-5.6.37]# php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
gd
hash
iconv
intl
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
zip
zlib

[Zend Modules]

[[email protected] php-5.6.37]#