Test Block Top

The Blog...
Articles, Tips & Trick and Other Interesting Information...

29 April 2012

Install PHP Pada CentOS

Pada artikel kali ini saya akan coba share cara paling gampang install php pada CentOS. Diasumsikan anda install CentOS dengan pilihan minimal install dan anda sudah setup local yum repository.

Untuk mulai install php, ketikkan command; yum install php*.


[root@linggih ~]# yum install php*
...
...
...
---> Package enchant.x86_64 1:1.5.0-4.el6 will be installed
--> Processing Dependency: libhunspell-1.2.so.0()(64bit) for package: 1:enchant-1.5.0-4.el6.x86_64
---> Package libc-client.x86_64 0:2007e-11.el6 will be installed
---> Package libedit.x86_64 0:2.11-4.20080712cvs.1.el6 will be installed
---> Package libtidy.x86_64 0:0.99.0-19.20070615.1.el6 will be installed
---> Package libxslt.x86_64 0:1.1.26-2.el6 will be installed
---> Package net-snmp.x86_64 1:5.5-37.el6_2.1 will be installed
--> Processing Dependency: libsensors.so.4()(64bit) for package: 1:net-snmp-5.5-37.el6_2.1.x86_64
---> Package net-snmp-libs.x86_64 1:5.5-37.el6_2.1 will be installed
---> Package postgresql-libs.x86_64 0:8.4.9-1.el6_1.1 will be installed
---> Package recode.x86_64 0:3.6-28.1.el6 will be installed
---> Package unixODBC.x86_64 0:2.2.14-11.el6 will be installed
--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.2.14-11.el6.x86_64
--> Running transaction check
---> Package hunspell.x86_64 0:1.2.8-16.el6 will be installed
---> Package libtool-ltdl.x86_64 0:2.2.6-15.5.el6 will be installed
---> Package lm_sensors-libs.x86_64 0:3.1.1-10.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package              Arch      Version                        Repository  Size
================================================================================
Installing:
php                  x86_64    5.3.3-3.el6_2.6                updates    1.1 M
php-bcmath           x86_64    5.3.3-3.el6_2.6                updates     32 k
php-cli              x86_64    5.3.3-3.el6_2.6                updates    2.2 M
php-common           x86_64    5.3.3-3.el6_2.6                updates    522 k
php-dba              x86_64    5.3.3-3.el6_2.6                updates     38 k
php-devel            x86_64    5.3.3-3.el6_2.6                updates    505 k
php-embedded         x86_64    5.3.3-3.el6_2.6                updates    1.1 M
php-enchant          x86_64    5.3.3-3.el6_2.6                updates     27 k
php-gd               x86_64    5.3.3-3.el6_2.6                updates    104 k
php-imap             x86_64    5.3.3-3.el6_2.6                updates     48 k
php-intl             x86_64    5.3.3-3.el6_2.6                updates     68 k
php-ldap             x86_64    5.3.3-3.el6_2.6                updates     36 k
php-mbstring         x86_64    5.3.3-3.el6_2.6                updates    453 k
php-mysql            x86_64    5.3.3-3.el6_2.6                updates     79 k
php-odbc             x86_64    5.3.3-3.el6_2.6                updates     48 k
php-pdo              x86_64    5.3.3-3.el6_2.6                updates     73 k
php-pear             noarch    1:1.9.4-4.el6                  base       393 k
php-pecl-apc         x86_64    3.1.3p1-1.2.el6.1              base        93 k
php-pecl-memcache    x86_64    3.0.5-3.el6                    base        60 k
php-pgsql            x86_64    5.3.3-3.el6_2.6                updates     68 k
php-process          x86_64    5.3.3-3.el6_2.6                updates     37 k
php-pspell           x86_64    5.3.3-3.el6_2.6                updates     26 k
php-recode           x86_64    5.3.3-3.el6_2.6                updates     23 k
php-snmp             x86_64    5.3.3-3.el6_2.6                updates     28 k
php-soap             x86_64    5.3.3-3.el6_2.6                updates    138 k
php-tidy             x86_64    5.3.3-3.el6_2.6                updates     34 k
php-xml              x86_64    5.3.3-3.el6_2.6                updates    100 k
php-xmlrpc           x86_64    5.3.3-3.el6_2.6                updates     50 k
php-zts              x86_64    5.3.3-3.el6_2.6                updates    1.2 M
Installing for dependencies:
aspell               x86_64    12:0.60.6-12.el6               base       648 k
enchant              x86_64    1:1.5.0-4.el6                  base        49 k
hunspell             x86_64    1.2.8-16.el6                   base       177 k
libc-client          x86_64    2007e-11.el6                   base       515 k
libedit              x86_64    2.11-4.20080712cvs.1.el6       base        74 k
libtidy              x86_64    0.99.0-19.20070615.1.el6       base       127 k
libtool-ltdl         x86_64    2.2.6-15.5.el6                 base        44 k
libxslt              x86_64    1.1.26-2.el6                   base       450 k
lm_sensors-libs      x86_64    3.1.1-10.el6                   base        37 k
net-snmp             x86_64    1:5.5-37.el6_2.1               updates    300 k
net-snmp-libs        x86_64    1:5.5-37.el6_2.1               updates    1.5 M
postgresql-libs      x86_64    8.4.9-1.el6_1.1                base       198 k
recode               x86_64    3.6-28.1.el6                   base       712 k
unixODBC             x86_64    2.2.14-11.el6                  base       378 k

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

Total download size: 14 M
Installed size: 47 M
Is this ok [y/N]: y
Downloading Packages:
(1/43): aspell-0.60.6-12.el6.x86_64.rpm                  | 648 kB     00:28
(2/43): enchant-1.5.0-4.el6.x86_64.rpm                   |  49 kB     00:02
(3/43): hunspell-1.2.8-16.el6.x86_64.rpm                 | 177 kB     00:06
(4/43): libc-client-2007e-11.el6.x86_64.rpm              | 515 kB     00:26
(5/43): libedit-2.11-4.20080712cvs.1.el6.x86_64.rpm      |  74 kB     00:04
(6/43): libtidy-0.99.0-19.20070615.1.el6.x86_64.rpm      | 127 kB     00:05
(7/43): libtool-ltdl-2.2.6-15.5.el6.x86_64.rpm           |  44 kB     00:01
(8/43): libxslt-1.1.26-2.el6.x86_64.rpm                  | 450 kB     00:29
(9/43): lm_sensors-libs-3.1.1-10.el6.x86_64.rpm          |  37 kB     00:01
(10/43): net-snmp-5.5-37.el6_2.1.x86_64.rpm              | 300 kB     00:14
(11/43): net-snmp-libs-5.5-37.el6_2.1.x86_64.rpm         | 1.5 MB     01:11
(12/43): php-5.3.3-3.el6_2.6.x86_64.rpm                  | 1.1 MB     01:04
(13/43): php-bcmath-5.3.3-3.el6_2.6.x86_64.rpm           |  32 kB     00:01
(14/43): php-cli-5.3.3-3.el6_2.6.x86_64.rpm              | 2.2 MB     01:45
(15/43): php-common-5.3.3-3.el6_2.6.x86_64.rpm           | 522 kB     00:21
(16/43): php-dba-5.3.3-3.el6_2.6.x86_64.rpm              |  38 kB     00:00
(17/43): php-devel-5.3.3-3.el6_2.6.x86_64.rpm            | 505 kB     00:19
(18/43): php-embedded-5.3.3-3.el6_2.6.x86_64.rpm         | 1.1 MB     00:50
(19/43): php-enchant-5.3.3-3.el6_2.6.x86_64.rpm          |  27 kB     00:00
(20/43): php-gd-5.3.3-3.el6_2.6.x86_64.rpm               | 104 kB     00:04
(21/43): php-imap-5.3.3-3.el6_2.6.x86_64.rpm             |  48 kB     00:04
(22/43): php-intl-5.3.3-3.el6_2.6.x86_64.rpm             |  68 kB     00:02
(23/43): php-ldap-5.3.3-3.el6_2.6.x86_64.rpm             |  36 kB     00:01
(24/43): php-mbstring-5.3.3-3.el6_2.6.x86_64.rpm         | 453 kB     00:20
(25/43): php-mysql-5.3.3-3.el6_2.6.x86_64.rpm            |  79 kB     00:03
(26/43): php-odbc-5.3.3-3.el6_2.6.x86_64.rpm             |  48 kB     00:03
(27/43): php-pdo-5.3.3-3.el6_2.6.x86_64.rpm              |  73 kB     00:03
(28/43): php-pear-1.9.4-4.el6.noarch.rpm                 | 393 kB     00:32
(29/43): php-pecl-apc-3.1.3p1-1.2.el6.1.x86_64.rpm       |  93 kB     00:04
(30/43): php-pecl-memcache-3.0.5-3.el6.x86_64.rpm        |  60 kB     00:02
(31/43): php-pgsql-5.3.3-3.el6_2.6.x86_64.rpm            |  68 kB     00:04
(32/43): php-process-5.3.3-3.el6_2.6.x86_64.rpm          |  37 kB     00:01
(33/43): php-pspell-5.3.3-3.el6_2.6.x86_64.rpm           |  26 kB     00:01
(34/43): php-recode-5.3.3-3.el6_2.6.x86_64.rpm           |  23 kB     00:02
(35/43): php-snmp-5.3.3-3.el6_2.6.x86_64.rpm             |  28 kB     00:00
(36/43): php-soap-5.3.3-3.el6_2.6.x86_64.rpm             | 138 kB     00:06
(37/43): php-tidy-5.3.3-3.el6_2.6.x86_64.rpm             |  34 kB     00:01
(38/43): php-xml-5.3.3-3.el6_2.6.x86_64.rpm              | 100 kB     00:16
(39/43): php-xmlrpc-5.3.3-3.el6_2.6.x86_64.rpm           |  50 kB     00:07
(40/43): php-zts-5.3.3-3.el6_2.6.x86_64.rpm              | 1.2 MB     01:54
(41/43): postgresql-libs-8.4.9-1.el6_1.1.x86_64.rpm      | 198 kB     00:07
(42/43): recode-3.6-28.1.el6.x86_64.rpm                  | 712 kB     00:25
(43/43): unixODBC-2.2.14-11.el6.x86_64.rpm               | 378 kB     00:16
--------------------------------------------------------------------------------
Total                                            19 kB/s |  14 MB     12:34
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : php-common-5.3.3-3.el6_2.6.x86_64                           1/43
Installing : php-pdo-5.3.3-3.el6_2.6.x86_64                              2/43
Installing : lm_sensors-libs-3.1.1-10.el6.x86_64                         3/43
Installing : 1:net-snmp-libs-5.5-37.el6_2.1.x86_64                       4/43
Installing : 1:net-snmp-5.5-37.el6_2.1.x86_64                            5/43
Installing : postgresql-libs-8.4.9-1.el6_1.1.x86_64                      6/43
Installing : libedit-2.11-4.20080712cvs.1.el6.x86_64                     7/43
Installing : php-cli-5.3.3-3.el6_2.6.x86_64                              8/43
Installing : 1:php-pear-1.9.4-4.el6.noarch                               9/43
Installing : php-5.3.3-3.el6_2.6.x86_64                                 10/43
Installing : recode-3.6-28.1.el6.x86_64                                 11/43
Installing : 12:aspell-0.60.6-12.el6.x86_64                             12/43
Installing : libxslt-1.1.26-2.el6.x86_64                                13/43
Installing : libc-client-2007e-11.el6.x86_64                            14/43
Installing : libtidy-0.99.0-19.20070615.1.el6.x86_64                    15/43
Installing : libtool-ltdl-2.2.6-15.5.el6.x86_64                         16/43
Installing : unixODBC-2.2.14-11.el6.x86_64                              17/43
Installing : hunspell-1.2.8-16.el6.x86_64                               18/43
Installing : 1:enchant-1.5.0-4.el6.x86_64                               19/43
Installing : php-enchant-5.3.3-3.el6_2.6.x86_64                         20/43
Installing : php-odbc-5.3.3-3.el6_2.6.x86_64                            21/43
Installing : php-tidy-5.3.3-3.el6_2.6.x86_64                            22/43
Installing : php-imap-5.3.3-3.el6_2.6.x86_64                            23/43
Installing : php-xml-5.3.3-3.el6_2.6.x86_64                             24/43
Installing : php-pspell-5.3.3-3.el6_2.6.x86_64                          25/43
Installing : php-recode-5.3.3-3.el6_2.6.x86_64                          26/43
Installing : php-devel-5.3.3-3.el6_2.6.x86_64                           27/43
Installing : php-pecl-apc-3.1.3p1-1.2.el6.1.x86_64                      28/43
Installing : php-pecl-memcache-3.0.5-3.el6.x86_64                       29/43
Installing : php-pgsql-5.3.3-3.el6_2.6.x86_64                           30/43
Installing : php-snmp-5.3.3-3.el6_2.6.x86_64                            31/43
Installing : php-mysql-5.3.3-3.el6_2.6.x86_64                           32/43
Installing : php-gd-5.3.3-3.el6_2.6.x86_64                              33/43
Installing : php-mbstring-5.3.3-3.el6_2.6.x86_64                        34/43
Installing : php-zts-5.3.3-3.el6_2.6.x86_64                             35/43
Installing : php-intl-5.3.3-3.el6_2.6.x86_64                            36/43
Installing : php-embedded-5.3.3-3.el6_2.6.x86_64                        37/43
Installing : php-soap-5.3.3-3.el6_2.6.x86_64                            38/43
Installing : php-process-5.3.3-3.el6_2.6.x86_64                         39/43
Installing : php-bcmath-5.3.3-3.el6_2.6.x86_64                          40/43
Installing : php-ldap-5.3.3-3.el6_2.6.x86_64                            41/43
Installing : php-dba-5.3.3-3.el6_2.6.x86_64                             42/43
Installing : php-xmlrpc-5.3.3-3.el6_2.6.x86_64                          43/43

Installed:
php.x86_64 0:5.3.3-3.el6_2.6
php-bcmath.x86_64 0:5.3.3-3.el6_2.6
php-cli.x86_64 0:5.3.3-3.el6_2.6
php-common.x86_64 0:5.3.3-3.el6_2.6
php-dba.x86_64 0:5.3.3-3.el6_2.6
php-devel.x86_64 0:5.3.3-3.el6_2.6
php-embedded.x86_64 0:5.3.3-3.el6_2.6
php-enchant.x86_64 0:5.3.3-3.el6_2.6
php-gd.x86_64 0:5.3.3-3.el6_2.6
php-imap.x86_64 0:5.3.3-3.el6_2.6
php-intl.x86_64 0:5.3.3-3.el6_2.6
php-ldap.x86_64 0:5.3.3-3.el6_2.6
php-mbstring.x86_64 0:5.3.3-3.el6_2.6
php-mysql.x86_64 0:5.3.3-3.el6_2.6
php-odbc.x86_64 0:5.3.3-3.el6_2.6
php-pdo.x86_64 0:5.3.3-3.el6_2.6
php-pear.noarch 1:1.9.4-4.el6
php-pecl-apc.x86_64 0:3.1.3p1-1.2.el6.1
php-pecl-memcache.x86_64 0:3.0.5-3.el6
php-pgsql.x86_64 0:5.3.3-3.el6_2.6
php-process.x86_64 0:5.3.3-3.el6_2.6
php-pspell.x86_64 0:5.3.3-3.el6_2.6
php-recode.x86_64 0:5.3.3-3.el6_2.6
php-snmp.x86_64 0:5.3.3-3.el6_2.6
php-soap.x86_64 0:5.3.3-3.el6_2.6
php-tidy.x86_64 0:5.3.3-3.el6_2.6
php-xml.x86_64 0:5.3.3-3.el6_2.6
php-xmlrpc.x86_64 0:5.3.3-3.el6_2.6
php-zts.x86_64 0:5.3.3-3.el6_2.6

Dependency Installed:
aspell.x86_64 12:0.60.6-12.el6
enchant.x86_64 1:1.5.0-4.el6
hunspell.x86_64 0:1.2.8-16.el6
libc-client.x86_64 0:2007e-11.el6
libedit.x86_64 0:2.11-4.20080712cvs.1.el6
libtidy.x86_64 0:0.99.0-19.20070615.1.el6
libtool-ltdl.x86_64 0:2.2.6-15.5.el6
libxslt.x86_64 0:1.1.26-2.el6
lm_sensors-libs.x86_64 0:3.1.1-10.el6
net-snmp.x86_64 1:5.5-37.el6_2.1
net-snmp-libs.x86_64 1:5.5-37.el6_2.1
postgresql-libs.x86_64 0:8.4.9-1.el6_1.1
recode.x86_64 0:3.6-28.1.el6
unixODBC.x86_64 0:2.2.14-11.el6

Complete!
[root@linggih ~]#

Setelah php terinstall, restart apache dengan command: /etc/init.d/httpd restart atau service httpd restart



[root@linggih ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@linggih ~]#

Untuk cek info php, buat file php baru dengan nama terserah (misalnya: phpinfo.php). Kemudian isikan code php berikut pada file php:



<?php phpinfo(); ?>



[root@linggih ~]# cd /var/www/html
[root@linggih html]# touch phpinfo.php
[root@linggih html]# nano phpinfo.php
[root@linggih html]#

Buka dokumen halaman php yang baru saja dibuat pada halaman web browser (http://domain-anda/phpinfo.php)

Install PHP: PHP Info

Install PHP: PHP Info

Selesai. Semoga bermanfaat.
:D

Tidak ada komentar:

Posting Komentar

Loncat ke Atas ↑