Sabtu, 27 Oktober 2018

How to install php 5.5 from source centos 6

  Tidak ada komentar
Install epel-release repository
[[email protected] ~]# yum install epel-release
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.biz.net.id
 * extras: centos.biz.net.id
 * updates: centos.biz.net.id
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package epel-release.noarch 0:6-8 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                              Arch                           Version                     Repository                      Size
======================================================================================================================================
Installing:
 epel-release                         noarch                         6-8                         extras                          14 k

Transaction Summary
======================================================================================================================================
Install       1 Package(s)

Total download size: 14 k
Installed size: 22 k
Is this ok [y/N]: y
Downloading Packages:
epel-release-6-8.noarch.rpm                                                                                    |  14 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : epel-release-6-8.noarch                                                                                            1/1
  Verifying  : epel-release-6-8.noarch                                                                                            1/1

Installed:
  epel-release.noarch 0:6-8

Complete!
[[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, security
Setting up Install Process
Loading mirror speeds from cached hostfile
epel/metalink                                                                                                  |  60 kB     00:00
 * base: centos.biz.net.id
 * epel: del-repos.extreme-ix.org
 * extras: centos.biz.net.id
 * updates: centos.biz.net.id
base                                                                                                           | 3.7 kB     00:00
base/primary_db                                                                                                | 4.7 MB     00:00
epel                                                                                                           | 3.2 kB     00:00
epel/primary                                                                                                   | 3.2 MB     00:02
epel                                                                                                                      12516/12516
extras                                                                                                         | 3.4 kB     00:00
extras/primary_db                                                                                              |  26 kB     00:00
mysql-connectors-community                                                                                     | 2.5 kB     00:00
mysql-connectors-community/primary_db                                                                          |  27 kB     00:00
mysql-tools-community                                                                                          | 2.5 kB     00:00
mysql-tools-community/primary_db                                                                               |  45 kB     00:00
updates                                                                                                        | 3.4 kB     00:00
updates/primary_db                                                                                             | 1.9 MB     00:00
Package autoconf-2.63-5.1.el6.noarch already installed and latest version
Package libtool-2.2.6-15.5.el6.x86_64 already installed and latest version
Package bison-2.4.1-5.el6.x86_64 already installed and latest version
Package libxml2-devel-2.7.6-21.el6_8.1.x86_64 already installed and latest version
Package bzip2-devel-1.0.5-7.el6_0.x86_64 already installed and latest version
Package 2:libpng-devel-1.2.49-2.el6_7.x86_64 already installed and latest version
Package openssl-devel-1.0.1e-57.el6.x86_64 already installed and latest version
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package gcc-c++.x86_64 0:4.4.7-18.el6 will be updated
---> Package gcc-c++.x86_64 0:4.4.7-23.el6 will be an update
--> Processing Dependency: libstdc++-devel = 4.4.7-23.el6 for package: gcc-c++-4.4.7-23.el6.x86_64
--> Processing Dependency: libstdc++ = 4.4.7-23.el6 for package: gcc-c++-4.4.7-23.el6.x86_64
--> Processing Dependency: gcc = 4.4.7-23.el6 for package: gcc-c++-4.4.7-23.el6.x86_64
---> Package libcurl-devel.x86_64 0:7.19.7-52.el6 will be updated
---> Package libcurl-devel.x86_64 0:7.19.7-53.el6_9 will be an update
--> Processing Dependency: libcurl = 7.19.7-53.el6_9 for package: libcurl-devel-7.19.7-53.el6_9.x86_64
---> Package libicu-devel.x86_64 0:4.2.1-14.el6 will be installed
---> Package libjpeg-turbo-devel.x86_64 0:1.2.1-3.el6_5 will be installed
---> Package libmcrypt-devel.x86_64 0:2.5.8-9.el6 will be installed
--> Processing Dependency: libmcrypt = 2.5.8-9.el6 for package: libmcrypt-devel-2.5.8-9.el6.x86_64
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: libmcrypt-devel-2.5.8-9.el6.x86_64
---> Package libwebp-devel.x86_64 0:0.4.3-3.el6 will be installed
--> Processing Dependency: libwebp(x86-64) = 0.4.3-3.el6 for package: libwebp-devel-0.4.3-3.el6.x86_64
--> Processing Dependency: libwebpmux.so.1()(64bit) for package: libwebp-devel-0.4.3-3.el6.x86_64
--> Processing Dependency: libwebpdemux.so.1()(64bit) for package: libwebp-devel-0.4.3-3.el6.x86_64
--> Processing Dependency: libwebpdecoder.so.1()(64bit) for package: libwebp-devel-0.4.3-3.el6.x86_64
--> Processing Dependency: libwebp.so.5()(64bit) for package: libwebp-devel-0.4.3-3.el6.x86_64
---> Package re2c.x86_64 0:0.13.5-1.el6 will be installed
--> Running transaction check
---> Package gcc.x86_64 0:4.4.7-18.el6 will be updated
--> Processing Dependency: gcc = 4.4.7-18.el6 for package: gcc-gfortran-4.4.7-18.el6.x86_64
---> Package gcc.x86_64 0:4.4.7-23.el6 will be an update
--> Processing Dependency: libgomp = 4.4.7-23.el6 for package: gcc-4.4.7-23.el6.x86_64
--> Processing Dependency: cpp = 4.4.7-23.el6 for package: gcc-4.4.7-23.el6.x86_64
--> Processing Dependency: libgcc >= 4.4.7-23.el6 for package: gcc-4.4.7-23.el6.x86_64
---> Package libcurl.x86_64 0:7.19.7-52.el6 will be updated
--> Processing Dependency: libcurl = 7.19.7-52.el6 for package: curl-7.19.7-52.el6.x86_64
---> Package libcurl.x86_64 0:7.19.7-53.el6_9 will be an update
---> Package libmcrypt.x86_64 0:2.5.8-9.el6 will be installed
---> Package libstdc++.x86_64 0:4.4.7-18.el6 will be updated
---> Package libstdc++.x86_64 0:4.4.7-23.el6 will be an update
---> Package libstdc++-devel.x86_64 0:4.4.7-18.el6 will be updated
---> Package libstdc++-devel.x86_64 0:4.4.7-23.el6 will be an update
---> Package libwebp.x86_64 0:0.4.3-3.el6 will be installed
--> Running transaction check
---> Package cpp.x86_64 0:4.4.7-18.el6 will be updated
---> Package cpp.x86_64 0:4.4.7-23.el6 will be an update
---> Package curl.x86_64 0:7.19.7-52.el6 will be updated
---> Package curl.x86_64 0:7.19.7-53.el6_9 will be an update
---> Package gcc-gfortran.x86_64 0:4.4.7-18.el6 will be updated
---> Package gcc-gfortran.x86_64 0:4.4.7-23.el6 will be an update
--> Processing Dependency: libgfortran = 4.4.7-23.el6 for package: gcc-gfortran-4.4.7-23.el6.x86_64
---> Package libgcc.x86_64 0:4.4.7-18.el6 will be updated
---> Package libgcc.x86_64 0:4.4.7-23.el6 will be an update
---> Package libgomp.x86_64 0:4.4.7-18.el6 will be updated
---> Package libgomp.x86_64 0:4.4.7-23.el6 will be an update
--> Running transaction check
---> Package libgfortran.x86_64 0:4.4.7-18.el6 will be updated
---> Package libgfortran.x86_64 0:4.4.7-23.el6 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                                Arch                      Version                               Repository               Size
======================================================================================================================================
Installing:
 libicu-devel                           x86_64                    4.2.1-14.el6                          base                    617 k
 libjpeg-turbo-devel                    x86_64                    1.2.1-3.el6_5                         base                     96 k
 libmcrypt-devel                        x86_64                    2.5.8-9.el6                           epel                     12 k
 libwebp-devel                          x86_64                    0.4.3-3.el6                           epel                     28 k
 re2c                                   x86_64                    0.13.5-1.el6                          epel                    200 k
Updating:
 gcc-c++                                x86_64                    4.4.7-23.el6                          base                    4.7 M
 libcurl-devel                          x86_64                    7.19.7-53.el6_9                       base                    247 k
Installing for dependencies:
 libmcrypt                              x86_64                    2.5.8-9.el6                           epel                     96 k
 libwebp                                x86_64                    0.4.3-3.el6                           epel                    210 k
Updating for dependencies:
 cpp                                    x86_64                    4.4.7-23.el6                          base                    3.7 M
 curl                                   x86_64                    7.19.7-53.el6_9                       base                    197 k
 gcc                                    x86_64                    4.4.7-23.el6                          base                     10 M
 gcc-gfortran                           x86_64                    4.4.7-23.el6                          base                    4.7 M
 libcurl                                x86_64                    7.19.7-53.el6_9                       base                    169 k
 libgcc                                 x86_64                    4.4.7-23.el6                          base                    104 k
 libgfortran                            x86_64                    4.4.7-23.el6                          base                    268 k
 libgomp                                x86_64                    4.4.7-23.el6                          base                    135 k
 libstdc++                              x86_64                    4.4.7-23.el6                          base                    296 k
 libstdc++-devel                        x86_64                    4.4.7-23.el6                          base                    1.6 M

Transaction Summary
======================================================================================================================================
Install       7 Package(s)
Upgrade      12 Package(s)

Total download size: 28 M
Downloading Packages:
(1/19): cpp-4.4.7-23.el6.x86_64.rpm                                                                            | 3.7 MB     00:00
(2/19): curl-7.19.7-53.el6_9.x86_64.rpm                                                                        | 197 kB     00:00
(3/19): gcc-4.4.7-23.el6.x86_64.rpm                                                                            |  10 MB     00:00
(4/19): gcc-c++-4.4.7-23.el6.x86_64.rpm                                                                        | 4.7 MB     00:00
(5/19): gcc-gfortran-4.4.7-23.el6.x86_64.rpm                                                                   | 4.7 MB     00:00
(6/19): libcurl-7.19.7-53.el6_9.x86_64.rpm                                                                     | 169 kB     00:00
(7/19): libcurl-devel-7.19.7-53.el6_9.x86_64.rpm                                                               | 247 kB     00:00
(8/19): libgcc-4.4.7-23.el6.x86_64.rpm                                                                         | 104 kB     00:00
(9/19): libgfortran-4.4.7-23.el6.x86_64.rpm                                                                    | 268 kB     00:00
(10/19): libgomp-4.4.7-23.el6.x86_64.rpm                                                                       | 135 kB     00:00
(11/19): libicu-devel-4.2.1-14.el6.x86_64.rpm                                                                  | 617 kB     00:00
(12/19): libjpeg-turbo-devel-1.2.1-3.el6_5.x86_64.rpm                                                          |  96 kB     00:00
(13/19): libmcrypt-2.5.8-9.el6.x86_64.rpm                                                                      |  96 kB     00:00
(14/19): libmcrypt-devel-2.5.8-9.el6.x86_64.rpm                                                                |  12 kB     00:00
(15/19): libstdc++-4.4.7-23.el6.x86_64.rpm                                                                     | 296 kB     00:00
(16/19): libstdc++-devel-4.4.7-23.el6.x86_64.rpm                                                               | 1.6 MB     00:00
(17/19): libwebp-0.4.3-3.el6.x86_64.rpm                                                                        | 210 kB     00:00
(18/19): libwebp-devel-0.4.3-3.el6.x86_64.rpm                                                                  |  28 kB     00:00
(19/19): re2c-0.13.5-1.el6.x86_64.rpm                                                                          | 200 kB     00:00
--------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                 2.0 MB/s |  28 MB     00:13
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
 Userid : EPEL (6) <[email protected]>
 Package: epel-release-6-8.noarch (@extras)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : libgcc-4.4.7-23.el6.x86_64                                                                                        1/31
  Updating   : libstdc++-4.4.7-23.el6.x86_64                                                                                     2/31
  Updating   : libcurl-7.19.7-53.el6_9.x86_64                                                                                    3/31
  Updating   : libstdc++-devel-4.4.7-23.el6.x86_64                                                                               4/31
  Updating   : cpp-4.4.7-23.el6.x86_64                                                                                           5/31
  Installing : libwebp-0.4.3-3.el6.x86_64                                                                                        6/31
  Installing : libmcrypt-2.5.8-9.el6.x86_64                                                                                      7/31
  Updating   : libgfortran-4.4.7-23.el6.x86_64                                                                                   8/31
  Updating   : libgomp-4.4.7-23.el6.x86_64                                                                                       9/31
  Updating   : gcc-4.4.7-23.el6.x86_64                                                                                          10/31
  Updating   : gcc-c++-4.4.7-23.el6.x86_64                                                                                      11/31
  Updating   : gcc-gfortran-4.4.7-23.el6.x86_64                                                                                 12/31
  Installing : libmcrypt-devel-2.5.8-9.el6.x86_64                                                                               13/31
  Installing : libwebp-devel-0.4.3-3.el6.x86_64                                                                                 14/31
  Updating   : curl-7.19.7-53.el6_9.x86_64                                                                                      15/31
  Updating   : libcurl-devel-7.19.7-53.el6_9.x86_64                                                                             16/31
  Installing : re2c-0.13.5-1.el6.x86_64                                                                                         17/31
  Installing : libjpeg-turbo-devel-1.2.1-3.el6_5.x86_64                                                                         18/31
  Installing : libicu-devel-4.2.1-14.el6.x86_64                                                                                 19/31
  Cleanup    : gcc-c++-4.4.7-18.el6.x86_64                                                                                      20/31
  Cleanup    : libstdc++-devel-4.4.7-18.el6.x86_64                                                                              21/31
  Cleanup    : libcurl-devel-7.19.7-52.el6.x86_64                                                                               22/31
  Cleanup    : gcc-gfortran-4.4.7-18.el6.x86_64                                                                                 23/31
  Cleanup    : gcc-4.4.7-18.el6.x86_64                                                                                          24/31
  Cleanup    : libstdc++-4.4.7-18.el6.x86_64                                                                                    25/31
  Cleanup    : curl-7.19.7-52.el6.x86_64                                                                                        26/31
  Cleanup    : libcurl-7.19.7-52.el6.x86_64                                                                                     27/31
  Cleanup    : libgcc-4.4.7-18.el6.x86_64                                                                                       28/31
  Cleanup    : cpp-4.4.7-18.el6.x86_64                                                                                          29/31
  Cleanup    : libgomp-4.4.7-18.el6.x86_64                                                                                      30/31
  Cleanup    : libgfortran-4.4.7-18.el6.x86_64                                                                                  31/31
  Verifying  : gcc-4.4.7-23.el6.x86_64                                                                                           1/31
  Verifying  : libicu-devel-4.2.1-14.el6.x86_64                                                                                  2/31
  Verifying  : libwebp-devel-0.4.3-3.el6.x86_64                                                                                  3/31
  Verifying  : re2c-0.13.5-1.el6.x86_64                                                                                          4/31
  Verifying  : libstdc++-devel-4.4.7-23.el6.x86_64                                                                               5/31
  Verifying  : libjpeg-turbo-devel-1.2.1-3.el6_5.x86_64                                                                          6/31
  Verifying  : curl-7.19.7-53.el6_9.x86_64                                                                                       7/31
  Verifying  : libgomp-4.4.7-23.el6.x86_64                                                                                       8/31
  Verifying  : libgfortran-4.4.7-23.el6.x86_64                                                                                   9/31
  Verifying  : gcc-c++-4.4.7-23.el6.x86_64                                                                                      10/31
  Verifying  : libcurl-devel-7.19.7-53.el6_9.x86_64                                                                             11/31
  Verifying  : gcc-gfortran-4.4.7-23.el6.x86_64                                                                                 12/31
  Verifying  : libcurl-7.19.7-53.el6_9.x86_64                                                                                   13/31
  Verifying  : libmcrypt-2.5.8-9.el6.x86_64                                                                                     14/31
  Verifying  : libwebp-0.4.3-3.el6.x86_64                                                                                       15/31
  Verifying  : libmcrypt-devel-2.5.8-9.el6.x86_64                                                                               16/31
  Verifying  : libstdc++-4.4.7-23.el6.x86_64                                                                                    17/31
  Verifying  : cpp-4.4.7-23.el6.x86_64                                                                                          18/31
  Verifying  : libgcc-4.4.7-23.el6.x86_64                                                                                       19/31
  Verifying  : libstdc++-devel-4.4.7-18.el6.x86_64                                                                              20/31
  Verifying  : gcc-c++-4.4.7-18.el6.x86_64                                                                                      21/31
  Verifying  : libcurl-7.19.7-52.el6.x86_64                                                                                     22/31
  Verifying  : libcurl-devel-7.19.7-52.el6.x86_64                                                                               23/31
  Verifying  : libgfortran-4.4.7-18.el6.x86_64                                                                                  24/31
  Verifying  : gcc-4.4.7-18.el6.x86_64                                                                                          25/31
  Verifying  : libstdc++-4.4.7-18.el6.x86_64                                                                                    26/31
  Verifying  : cpp-4.4.7-18.el6.x86_64                                                                                          27/31
  Verifying  : curl-7.19.7-52.el6.x86_64                                                                                        28/31
  Verifying  : libgcc-4.4.7-18.el6.x86_64                                                                                       29/31
  Verifying  : gcc-gfortran-4.4.7-18.el6.x86_64                                                                                 30/31
  Verifying  : libgomp-4.4.7-18.el6.x86_64                                                                                      31/31

Installed:
  libicu-devel.x86_64 0:4.2.1-14.el6       libjpeg-turbo-devel.x86_64 0:1.2.1-3.el6_5       libmcrypt-devel.x86_64 0:2.5.8-9.el6
  libwebp-devel.x86_64 0:0.4.3-3.el6       re2c.x86_64 0:0.13.5-1.el6

Dependency Installed:
  libmcrypt.x86_64 0:2.5.8-9.el6                                     libwebp.x86_64 0:0.4.3-3.el6

Updated:
  gcc-c++.x86_64 0:4.4.7-23.el6                                 libcurl-devel.x86_64 0:7.19.7-53.el6_9

Dependency Updated:
  cpp.x86_64 0:4.4.7-23.el6                       curl.x86_64 0:7.19.7-53.el6_9              gcc.x86_64 0:4.4.7-23.el6
  gcc-gfortran.x86_64 0:4.4.7-23.el6              libcurl.x86_64 0:7.19.7-53.el6_9           libgcc.x86_64 0:4.4.7-23.el6
  libgfortran.x86_64 0:4.4.7-23.el6               libgomp.x86_64 0:4.4.7-23.el6              libstdc++.x86_64 0:4.4.7-23.el6
  libstdc++-devel.x86_64 0:4.4.7-23.el6

Complete!
[[email protected] ~]#
Download php from official website
[[email protected] ~]# wget http://id1.php.net/distributions/php-5.5.17.tar.gz
--2018-10-27 15:33:47--  http://id1.php.net/distributions/php-5.5.17.tar.gz
Connecting to 192.168.71.17:9898... connected.
Proxy request sent, awaiting response... 200 OK
Length: 17120280 (16M) [application/x-gzip]
Saving to: “php-5.5.17.tar.gz”

100%[============================================================================================>] 17,120,280   251K/s   in 74s

2018-10-27 15:35:03 (227 KB/s) - “php-5.5.17.tar.gz” saved [17120280/17120280]

[[email protected] ~]#
[[email protected] ~]# ls
anaconda-ks.cfg   apr-util-1.6.1.tar.gz  httpd-2.4.28.tar.gz  install.log         mysql80-community-release-el6-1.noarch.rpm
apr-1.6.5.tar.gz  db_bak                 httpd-2.4.36         install.log.syslog  php-5.5.17.tar.gz
[[email protected] ~]#
Extract php source
[[email protected] ~]# tar -xzf php-5.5.17.tar.gz
[[email protected] ~]# ls
anaconda-ks.cfg        db_bak               install.log                                 php-5.5.17
apr-1.6.5.tar.gz       httpd-2.4.28.tar.gz  install.log.syslog                          php-5.5.17.tar.gz
apr-util-1.6.1.tar.gz  httpd-2.4.36         mysql80-community-release-el6-1.noarch.rpm
[[email protected] ~]#
Change working directory to php extracted folder
[[email protected] ~]# cd php-5.5.17
[[email protected] php-5.5.17]# ls
acinclude.m4      genfiles         NEWS                          README.PHP4-TO-PHP5-THIN-CHANGES  snapshot
aclocal.m4        header           pear                          README.REDIST.BINS                stamp-h.in
build             INSTALL          php5.spec.in                  README.RELEASE_PROCESS            stub.c
buildconf         install-sh       php.gif                       README.SELF-CONTAINED-EXTENSIONS  svnclean.bat
buildconf.bat     LICENSE          php.ini-development           README.STREAMS                    tests
CODING_STANDARDS  ltmain.sh        php.ini-production            README.SUBMITTING_PATCH           travis
config.guess      main             README.EXTENSIONS             README.TESTING                    TSRM
config.sub        makedist         README.EXT_SKEL               README.TESTING2                   UPGRADING
configure         Makefile.frag    README.GIT-RULES              README.UNIX-BUILD-SYSTEM          UPGRADING.INTERNALS
configure.in      Makefile.gcov    README.input_filter           README.WIN32-BUILD-SYSTEM         vcsclean
CREDITS           Makefile.global  README.MAILINGLIST_RULES      run-tests.php                     win32
ext               makerpm          README.md                     sapi                              Zend
EXTENSIONS        missing          README.namespaces             scripts
footer            mkinstalldirs    README.NEW-OUTPUT-API         server-tests-config.php
generated_lists   netware          README.PARAMETER_PARSING_API  server-tests.php
[[email protected] php-5.5.17]# ./buildconf
You should not run buildconf in a release package.
use buildconf --force to override this check.
[[email protected] php-5.5.17]# ./buildconf --force
Forcing buildconf
Removing configure caches
buildconf: checking installation...
buildconf: autoconf version 2.63 (ok)
[[email protected] php-5.5.17]#
[[email protected] php-5.5.17]#
Execute Configure help to show the configure option and documentation
[[email protected] php-5.5.17]# ./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:


Configure the php
[[email protected] php-5.5.17]# ./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-config-file-scan-dir=/usr/local/php5/etc/conf.d --with-apxs2=/usr/local/apache2/bin/apxs  --enable-sysvshm  --enable-sysvsem  --enable-sysvmsg --enable-shmop --disable-short-tags --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd  --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-cgi
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... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking how to run the C preprocessor... cc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
..
..

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.5.17]#
Make the php
[[email protected] php-5.5.17]# make
/bin/sh /root/php-5.5.17/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/date/lib -Iext/date/ -I/root/php-5.5.17/ext/date/ -DPHP_ATOM_INC -I/root/php-5.5.17/include -I/root/php-5.5.17/main -I/root/php-5.5.17 -I/root/php-5.5.17/ext/date/lib -I/root/php-5.5.17/ext/ereg/regex -I/usr/include/libxml2 -I/usr/include/freetype2 -I/root/php-5.5.17/ext/mbstring/oniguruma -I/root/php-5.5.17/ext/mbstring/libmbfl -I/root/php-5.5.17/ext/mbstring/libmbfl/mbfl -I/root/php-5.5.17/ext/sqlite3/libsqlite -I/root/php-5.5.17/TSRM -I/root/php-5.5.17/Zend    -I/usr/include -g -O2 -fvisibility=hidden  -c /root/php-5.5.17/ext/date/php_date.c -o ext/date/php_date.lo
/bin/sh /root/php-5.5.17/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/date/lib -Iext/date/ -I/root/php-5.5.17/ext/date/ -DPHP_ATOM_INC -I/root/php-5.5.17/include -I/root/php-5.5.17/main -I/root/php-5.5.17 -I/root/php-5.5.17/ext/date/lib -I/root/php-5.5.17/ext/ereg/regex -I/usr/include/libxml2 -I/usr/include/freetype2 -I/root/php-5.5.17/ext/mbstring/oniguruma -I/root/php-5.5.17/ext/mbstring/libmbfl -I/root/php-5.5.17/ext/mbstring/libmbfl/mbfl -I/root/php-5.5.17/ext/sqlite3/libsqlite -I/root/php-5.5.17/TSRM -I/root/php-5.5.17/Zend    -I/usr/include -g -O2 -fvisibility=hidden  -c /root/php-5.5.17/ext/date/lib/astro.c -o ext/date/lib/astro.lo
/bin/sh /root/php-5.5.17/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/date/lib -Iext/date/ -I/root/php-5.5.17/ext/date/ -DPHP_ATOM_INC -I/root/php-5.5.17/include -I/root/php-5.5.17/main -I/root/php-5.5.17 -I/root/php-5.5.17/ext/date/lib -I/root/php-5.5.17/ext/ereg/regex -I/usr/include/libxml2 -I/usr/include/freetype2 -I/root/php-5.5.17/ext/mbstring/oniguruma -I/root/php-5.5.17/ext/mbstring/libmbfl -I/root/php-5.5.17/ext/mbstring/libmbfl/mbfl -I/root/php-5.5.17/ext/sqlite3/libsqlite -I/root/php-5.5.17/TSRM -I/root/php-5.5.17/Zend    -I/usr/include -g -O2 -fvisibility=hidden  -c /root/php-5.5.17/ext/date/lib/dow.c -o ext/date/lib/dow.lo
/bin/sh /root/php-5.5.17/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/date/lib -Iext/date/ -I/root/php-5.5.17/ext/date/ -DPHP_ATOM_INC -I/root/php-5.5.17/include -I/root/php-5.5.17/main -I/root/php-5.5.17 -I/root/php-5.5.17/ext/date/lib -I/root/php-5.5.17/ext/ereg/regex -I/usr/include/libxml2 -I/usr/include/freetype2 -I/root/php-5.5.17/ext/mbstring/oniguruma -I/root/php-5.5.17/ext/mbstring/libmbfl -I/root/php-5.5.17/ext/mbstring/libmbfl/mbfl -I/root/php-5.5.17/ext/sqlite3/libsqlite -I/root/php-5.5.17/TSRM -I/root/php-5.5.17/Zend    -I/usr/include -g -O2 -fvisibility=hidden  -c /root/php-5.5.17/ext/date/lib/parse_date.c -o ext/date/lib/parse_date.lo
..
..
gc.lo Zend/zend_closures.lo Zend/zend_float.lo Zend/zend_string.lo Zend/zend_signal.lo Zend/zend_generators.lo Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_default_classes.lo Zend/zend_execute.lo main/internal_functions_cli.lo sapi/cgi/cgi_main.lo sapi/cgi/fastcgi.lo -lcrypt -lz -lexslt -lcrypt -lrt -lmcrypt -lpng -lz -ljpeg -lcurl -lbz2 -lz -lrt -lm -ldl -lnsl -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lcurl -lxml2 -lz -lm -lssl -lcrypto -lfreetype -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxslt -lxml2 -lz -lm -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.
pharcommand.inc
clicommand.inc
directorygraphiterator.inc
directorytreeiterator.inc
invertedregexiterator.inc
phar.inc

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

[[email protected] php-5.5.17]#
Make install the php
[[email protected] php-5.5.17]# make install
Installing PHP SAPI module:       apache2handler
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install install libphp5.la /usr/local/apache2/modules/
libtool: install: install .libs/libphp5.so /usr/local/apache2/modules/libphp5.so
libtool: install: install .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /root/php-5.5.17/libs'
chmod 755 /usr/local/apache2/modules/libphp5.so
[activating module `php5' in /usr/local/apache2/conf/httpd.conf]
Installing shared extensions:     /usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/
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.3.12
[PEAR] Console_Getopt   - installed: 1.3.1
[PEAR] Structures_Graph - installed: 1.0.4
[PEAR] XML_Util         - installed: 1.2.3
[PEAR] PEAR             - installed: 1.9.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.5.17/build/shtool install -c ext/phar/phar.phar /usr/local/php5/bin
ln -s -f /usr/local/php5/bin/phar.phar /usr/local/php5/bin/phar
Installing PDO headers:          /usr/local/php5/include/php/ext/pdo/
[[email protected] php-5.5.17]#

PHP Configuration


Find php ini configuration path and configuration folder

[[email protected] php-5.5.17]# php -i | grep "Configuration File"
Configuration File (php.ini) Path => /usr/local/php5/etc
Loaded Configuration File => (none)
[[email protected] php-5.5.17]# php -i | grep "Scan this"
Scan this dir for additional .ini files => /usr/local/php5/etc/conf.d
[[email protected] php-5.5.17]#
Copy php.ini template to configuration folder, and simlink the file to /etc folder 

[[email protected] php-5.5.17]# cp php.ini-production /usr/local/php5/etc/php.ini
[[email protected] php-5.5.17]# ln -s /usr/local/php5/etc/php.ini /etc

php.ini and OPCache configuration
Second thing is php.ini file. After installation  php.ini file should located in /usr/local/php/lib. This is only the location. After compiling from source You won't anything there so we need to copy it from uncompressed sources.
[[email protected] php-5.5.17]# cd /usr/local/php5/
[[email protected] php5]# ls
bin  etc  include  lib  php  sbin  var
[[email protected] php5]# cd etc/
[[email protected] etc]# ls
pear.conf  php-fpm.conf.default
[[email protected] etc]# mkdir conf.d
[[email protected] etc]# ls
conf.d  pear.conf  php-fpm.conf.default
[[email protected] etc]# cp ~/php-5.5.17/php.ini-development php.ini
[[email protected] etc]# ls
conf.d  pear.conf  php-fpm.conf.default  php.ini
[[email protected] etc]#
This is pretty large file with lot of configuration settings. Fortunately we only need to change some of the options:
short_open_tag = On
open_basedir = /var/www
disable_functions = exec,passthru,shell_exec,system,proc_open,popen
expose_php = Off
max_execution_time = 30
memory_limit = 64M
date.timezone = Europe/Warsaw
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
post_max_size = 5M
upload_max_filesize = 4M

opcache.enable=1
opcache.memory_consumption=64
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=7000
opcache.validate_timestamps=0 ;set this to 1 on production server
opcache.fast_shutdown=1
So we set few things here, enable <? tag, limit access to files from PHP level, disabled dangerous functions, adjusts timezone, security, max execution times, errors etc. In addition we have enable OPCache for PHP.
Each one of these options are well commented inside php.ini file. If You don't like the settings here or You need something else, feel free to change it for Your purposes.

Setup Add PHP to $PATH

We can do one more thing to make our life easier:) Add PHP executable to PATH, so we'll be able to call php command from every directory.
[[email protected] php-5.5.17]# php -v
-bash: php: command not found
[[email protected] php-5.5.17]#
[[email protected] php-5.5.17]# echo 'pathmunge /usr/local/php5/bin' > /etc/profile.d/php5.sh
[ro[email protected] php-5.5.17]# exit
logout
Execute such command, log out, log in and You'll be able to execute:
[[email protected] php-5.5.17]# php -v
-bash: php: command not found
[[email protected] php-5.5.17]#
[[email protected] php-5.5.17]# echo 'pathmunge /usr/local/php5/bin' > /etc/profile.d/php5.sh
[[email protected] php-5.5.17]# exit
logout
Connection to 192.168.71.25 closed.
[[email protected] ~]$ ssh [email protected]
[email protected]'s password:
Last login: Sat Oct 27 15:30:35 2018 from 192.168.74.28
[[email protected] ~]# php -v
PHP 5.5.17 (cli) (built: Oct 27 2018 15:53:37)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
[[email protected] ~]#
Check php modules
[[email protected] php-5.5.17]# php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

[Zend Modules]

[[email protected] php-5.5.17]#


Tidak ada komentar :

Posting Komentar