How to Install and Configure PHP 5.3.3 on CentOS 6.4

PHP 5.3.3 is an older version of PHP that is still used by some applications. However, CentOS 6.4 comes with PHP 5.3.3 but it may not be installed by default or may need to be upgraded.

In this howto, we will show you how to install PHP 5.3.3 on CentOS 6.4 and configure it for use with Apache.

Step 1: Install the EPEL and Remi Repositories

PHP 5.3.3 is not available in the default CentOS 6.4 repositories, so we will need to install the EPEL and Remi repositories. To do this, run the following commands:

sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Step 2: Install PHP 5.3.3

Once you have installed the EPEL and Remi repositories, you can install PHP 5.3.3 with the following command:

sudo yum --enablerepo=remi install php php-common php-cli php-devel php-mysql php-pdo php-xml php-pear php-bcmath php-mbstring

This command will install PHP 5.3.3 along with some necessary extensions.

Example:

[root@centos64 ~]# yum install php* -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ipserverone.com
 * extras: centos.ipserverone.com
 * updates: centos.ipserverone.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: httpd-mmn = 20051115 for package: php-5.3.3-22.el6.x86_64
--> Processing Dependency: httpd for package: php-5.3.3-22.el6.x86_64
---> Package php-bcmath.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-cli.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-common.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-dba.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-devel.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: automake for package: php-devel-5.3.3-22.el6.x86_64
--> Processing Dependency: autoconf for package: php-devel-5.3.3-22.el6.x86_64
---> Package php-embedded.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-enchant.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libenchant.so.1()(64bit) for package: php-enchant-5.3.3-22.el6.x86_64
---> Package php-fpm.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-gd.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libpng12.so.0(PNG12_0)(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libpng12.so.0()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libjpeg.so.62()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libfreetype.so.6()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libXpm.so.4()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
---> Package php-imap.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libc-client.so.2007()(64bit) for package: php-imap-5.3.3-22.el6.x86_64
---> Package php-intl.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libicuuc.so.42()(64bit) for package: php-intl-5.3.3-22.el6.x86_64
--> Processing Dependency: libicuio.so.42()(64bit) for package: php-intl-5.3.3-22.el6.x86_64
--> Processing Dependency: libicui18n.so.42()(64bit) for package: php-intl-5.3.3-22.el6.x86_64
--> Processing Dependency: libicudata.so.42()(64bit) for package: php-intl-5.3.3-22.el6.x86_64
---> Package php-ldap.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-mbstring.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-mysql.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-odbc.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libodbc.so.2()(64bit) for package: php-odbc-5.3.3-22.el6.x86_64
---> Package php-pdo.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-pear.noarch 1:1.9.4-4.el6 will be installed
---> Package php-pecl-apc.x86_64 0:3.1.9-2.el6 will be installed
---> Package php-pecl-apc-devel.x86_64 0:3.1.9-2.el6 will be installed
---> Package php-pecl-memcache.x86_64 0:3.0.5-4.el6 will be installed
---> Package php-pgsql.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libpq.so.5()(64bit) for package: php-pgsql-5.3.3-22.el6.x86_64
---> Package php-process.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-pspell.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libpspell.so.15()(64bit) for package: php-pspell-5.3.3-22.el6.x86_64
--> Processing Dependency: libaspell.so.15()(64bit) for package: php-pspell-5.3.3-22.el6.x86_64
---> Package php-recode.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: librecode.so.0()(64bit) for package: php-recode-5.3.3-22.el6.x86_64
---> Package php-snmp.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: net-snmp for package: php-snmp-5.3.3-22.el6.x86_64
--> Processing Dependency: libnetsnmp.so.20()(64bit) for package: php-snmp-5.3.3-22.el6.x86_64
---> Package php-soap.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-tidy.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libtidy-0.99.so.0()(64bit) for package: php-tidy-5.3.3-22.el6.x86_64
---> Package php-xml.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1()(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libexslt.so.0()(64bit) for package: php-xml-5.3.3-22.el6.x86_64
---> Package php-xmlrpc.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-zts.x86_64 0:5.3.3-22.el6 will be installed
--> Running transaction check
---> Package aspell.x86_64 12:0.60.6-12.el6 will be installed
---> Package autoconf.noarch 0:2.63-5.1.el6 will be installed
---> Package automake.noarch 0:1.11.1-4.el6 will be installed
---> 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 freetype.x86_64 0:2.3.11-14.el6_3.1 will be installed
---> Package httpd.x86_64 0:2.2.15-26.el6.centos will be installed
--> Processing Dependency: httpd-tools = 2.2.15-26.el6.centos for package: httpd-2.2.15-26.el6.centos.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-26.el6.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.2.15-26.el6.centos.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-26.el6.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.2.15-26.el6.centos.x86_64
---> Package libX11.x86_64 0:1.5.0-4.el6 will be installed
--> Processing Dependency: libX11-common = 1.5.0-4.el6 for package: libX11-1.5.0-4.el6.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.5.0-4.el6.x86_64
---> Package libXpm.x86_64 0:3.5.10-2.el6 will be installed
---> Package libc-client.x86_64 0:2007e-11.el6 will be installed
---> Package libicu.x86_64 0:4.2.1-9.1.el6_2 will be installed
---> Package libjpeg-turbo.x86_64 0:1.2.1-1.el6 will be installed
---> Package libpng.x86_64 2:1.2.49-1.el6_2 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_3.1 will be installed
---> Package net-snmp.x86_64 1:5.5-44.el6 will be installed
--> Processing Dependency: libsensors.so.4()(64bit) for package: 1:net-snmp-5.5-44.el6.x86_64
---> Package net-snmp-libs.x86_64 1:5.5-44.el6 will be installed
---> Package postgresql-libs.x86_64 0:8.4.13-1.el6_3 will be installed
---> Package recode.x86_64 0:3.6-28.1.el6 will be installed
---> Package unixODBC.x86_64 0:2.2.14-12.el6_3 will be installed
--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.2.14-12.el6_3.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-5.el6_2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package httpd-tools.x86_64 0:2.2.15-26.el6.centos will be installed
---> Package hunspell.x86_64 0:1.2.8-16.el6 will be installed
---> Package libX11-common.noarch 0:1.5.0-4.el6 will be installed
---> Package libtool-ltdl.x86_64 0:2.2.6-15.5.el6 will be installed
---> Package libxcb.x86_64 0:1.8.1-1.el6 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.8.1-1.el6.x86_64
---> Package lm_sensors-libs.x86_64 0:3.1.1-17.el6 will be installed
---> Package mailcap.noarch 0:2.1.31-2.el6 will be installed
--> Running transaction check
---> Package libXau.x86_64 0:1.0.6-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================
 Package                       Arch              Version                             Repository          Size
==============================================================================================================
Installing:
 php                           x86_64            5.3.3-22.el6                        base               1.1 M
 php-bcmath                    x86_64            5.3.3-22.el6                        base                34 k
 php-cli                       x86_64            5.3.3-22.el6                        base               2.2 M
 php-common                    x86_64            5.3.3-22.el6                        base               524 k
 php-dba                       x86_64            5.3.3-22.el6                        base                40 k
 php-devel                     x86_64            5.3.3-22.el6                        base               507 k
 php-embedded                  x86_64            5.3.3-22.el6                        base               1.1 M
 php-enchant                   x86_64            5.3.3-22.el6                        base                28 k
 php-fpm                       x86_64            5.3.3-22.el6                        base               1.1 M
 php-gd                        x86_64            5.3.3-22.el6                        base               106 k
 php-imap                      x86_64            5.3.3-22.el6                        base                50 k
 php-intl                      x86_64            5.3.3-22.el6                        base                70 k
 php-ldap                      x86_64            5.3.3-22.el6                        base                38 k
 php-mbstring                  x86_64            5.3.3-22.el6                        base               455 k
 php-mysql                     x86_64            5.3.3-22.el6                        base                81 k
 php-odbc                      x86_64            5.3.3-22.el6                        base                50 k
 php-pdo                       x86_64            5.3.3-22.el6                        base                75 k
 php-pear                      noarch            1:1.9.4-4.el6                       base               393 k
 php-pecl-apc                  x86_64            3.1.9-2.el6                         base                96 k
 php-pecl-apc-devel            x86_64            3.1.9-2.el6                         base               6.7 k
 php-pecl-memcache             x86_64            3.0.5-4.el6                         base                60 k
 php-pgsql                     x86_64            5.3.3-22.el6                        base                70 k
 php-process                   x86_64            5.3.3-22.el6                        base                39 k
 php-pspell                    x86_64            5.3.3-22.el6                        base                28 k
 php-recode                    x86_64            5.3.3-22.el6                        base                25 k
 php-snmp                      x86_64            5.3.3-22.el6                        base                30 k
 php-soap                      x86_64            5.3.3-22.el6                        base               139 k
 php-tidy                      x86_64            5.3.3-22.el6                        base                35 k
 php-xml                       x86_64            5.3.3-22.el6                        base               103 k
 php-xmlrpc                    x86_64            5.3.3-22.el6                        base                52 k
 php-zts                       x86_64            5.3.3-22.el6                        base               1.2 M
Installing for dependencies:
 apr                           x86_64            1.3.9-5.el6_2                       base               123 k
 apr-util                      x86_64            1.3.9-3.el6_0.1                     base                87 k
 apr-util-ldap                 x86_64            1.3.9-3.el6_0.1                     base                15 k
 aspell                        x86_64            12:0.60.6-12.el6                    base               648 k
 autoconf                      noarch            2.63-5.1.el6                        base               781 k
 automake                      noarch            1.11.1-4.el6                        base               550 k
 enchant                       x86_64            1:1.5.0-4.el6                       base                49 k
 freetype                      x86_64            2.3.11-14.el6_3.1                   updates            359 k
 httpd                         x86_64            2.2.15-26.el6.centos                base               821 k
 httpd-tools                   x86_64            2.2.15-26.el6.centos                base                72 k
 hunspell                      x86_64            1.2.8-16.el6                        base               177 k
 libX11                        x86_64            1.5.0-4.el6                         base               584 k
 libX11-common                 noarch            1.5.0-4.el6                         base               192 k
 libXau                        x86_64            1.0.6-4.el6                         base                24 k
 libXpm                        x86_64            3.5.10-2.el6                        base                51 k
 libc-client                   x86_64            2007e-11.el6                        base               515 k
 libicu                        x86_64            4.2.1-9.1.el6_2                     base               4.9 M
 libjpeg-turbo                 x86_64            1.2.1-1.el6                         base               174 k
 libpng                        x86_64            2:1.2.49-1.el6_2                    base               182 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
 libxcb                        x86_64            1.8.1-1.el6                         base               110 k
 libxslt                       x86_64            1.1.26-2.el6_3.1                    base               452 k
 lm_sensors-libs               x86_64            3.1.1-17.el6                        base                38 k
 mailcap                       noarch            2.1.31-2.el6                        base                27 k
 net-snmp                      x86_64            1:5.5-44.el6                        base               303 k
 net-snmp-libs                 x86_64            1:5.5-44.el6                        base               1.5 M
 postgresql-libs               x86_64            8.4.13-1.el6_3                      base               200 k
 recode                        x86_64            3.6-28.1.el6                        base               712 k
 unixODBC                      x86_64            2.2.14-12.el6_3                     base               378 k

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

Total download size: 24 M
Installed size: 82 M
Downloading Packages:
(1/61): apr-1.3.9-5.el6_2.x86_64.rpm                                                   | 123 kB     00:02
(2/61): apr-util-1.3.9-3.el6_0.1.x86_64.rpm                                            |  87 kB     00:00
(3/61): apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm                                       |  15 kB     00:00
(4/61): aspell-0.60.6-12.el6.x86_64.rpm                                                | 648 kB     00:08
(5/61): autoconf-2.63-5.1.el6.noarch.rpm                                               | 781 kB     00:06
(6/61): automake-1.11.1-4.el6.noarch.rpm                                               | 550 kB     00:06
(7/61): enchant-1.5.0-4.el6.x86_64.rpm                                                 |  49 kB     00:00
(8/61): freetype-2.3.11-14.el6_3.1.x86_64.rpm                                          | 359 kB     00:04
(9/61): httpd-2.2.15-26.el6.centos.x86_64.rpm                                          | 821 kB     00:18
(10/61): httpd-tools-2.2.15-26.el6.centos.x86_64.rpm                                   |  72 kB     00:00
(11/61): hunspell-1.2.8-16.el6.x86_64.rpm                                              | 177 kB     00:01
(12/61): libX11-1.5.0-4.el6.x86_64.rpm                                                 | 584 kB     00:10
(13/61): libX11-common-1.5.0-4.el6.noarch.rpm                                          | 192 kB     00:01
(14/61): libXau-1.0.6-4.el6.x86_64.rpm                                                 |  24 kB     00:00
(15/61): libXpm-3.5.10-2.el6.x86_64.rpm                                                |  51 kB     00:00
(16/61): libc-client-2007e-11.el6.x86_64.rpm                                           | 515 kB     00:05
(17/61): libicu-4.2.1-9.1.el6_2.x86_64.rpm                                             | 4.9 MB     00:54
(18/61): libjpeg-turbo-1.2.1-1.el6.x86_64.rpm                                          | 174 kB     00:02
(19/61): libpng-1.2.49-1.el6_2.x86_64.rpm                                              | 182 kB     00:01
(20/61): libtidy-0.99.0-19.20070615.1.el6.x86_64.rpm                                   | 127 kB     00:01
(21/61): libtool-ltdl-2.2.6-15.5.el6.x86_64.rpm                                        |  44 kB     00:00
(22/61): libxcb-1.8.1-1.el6.x86_64.rpm                                                 | 110 kB     00:00
(23/61): libxslt-1.1.26-2.el6_3.1.x86_64.rpm                                           | 452 kB     00:03
(24/61): lm_sensors-libs-3.1.1-17.el6.x86_64.rpm                                       |  38 kB     00:01
(25/61): mailcap-2.1.31-2.el6.noarch.rpm                                               |  27 kB     00:00
(26/61): net-snmp-5.5-44.el6.x86_64.rpm                                                | 303 kB     00:03
(27/61): net-snmp-libs-5.5-44.el6.x86_64.rpm                                           | 1.5 MB     00:17
(28/61): php-5.3.3-22.el6.x86_64.rpm                                                   | 1.1 MB     00:11
(29/61): php-bcmath-5.3.3-22.el6.x86_64.rpm                                            |  34 kB     00:00
(30/61): php-cli-5.3.3-22.el6.x86_64.rpm                                               | 2.2 MB     00:24
(31/61): php-common-5.3.3-22.el6.x86_64.rpm                                            | 524 kB     00:07
(32/61): php-dba-5.3.3-22.el6.x86_64.rpm                                               |  40 kB     00:00
(33/61): php-devel-5.3.3-22.el6.x86_64.rpm                                             | 507 kB     00:04
(34/61): php-embedded-5.3.3-22.el6.x86_64.rpm                                          | 1.1 MB     00:10
(35/61): php-enchant-5.3.3-22.el6.x86_64.rpm                                           |  28 kB     00:00
(36/61): php-fpm-5.3.3-22.el6.x86_64.rpm                                               | 1.1 MB     00:11
(37/61): php-gd-5.3.3-22.el6.x86_64.rpm                                                | 106 kB     00:00
(38/61): php-imap-5.3.3-22.el6.x86_64.rpm                                              |  50 kB     00:01
(39/61): php-intl-5.3.3-22.el6.x86_64.rpm                                              |  70 kB     00:00
(40/61): php-ldap-5.3.3-22.el6.x86_64.rpm                                              |  38 kB     00:00
(41/61): php-mbstring-5.3.3-22.el6.x86_64.rpm                                          | 455 kB     00:05
(42/61): php-mysql-5.3.3-22.el6.x86_64.rpm                                             |  81 kB     00:00
(43/61): php-odbc-5.3.3-22.el6.x86_64.rpm                                              |  50 kB     00:00
(44/61): php-pdo-5.3.3-22.el6.x86_64.rpm                                               |  75 kB     00:00
(45/61): php-pear-1.9.4-4.el6.noarch.rpm                                               | 393 kB     00:12
(46/61): php-pecl-apc-3.1.9-2.el6.x86_64.rpm                                           |  96 kB     00:00
(47/61): php-pecl-apc-devel-3.1.9-2.el6.x86_64.rpm                                     | 6.7 kB     00:00
(48/61): php-pecl-memcache-3.0.5-4.el6.x86_64.rpm                                      |  60 kB     00:00
(49/61): php-pgsql-5.3.3-22.el6.x86_64.rpm                                             |  70 kB     00:00
(50/61): php-process-5.3.3-22.el6.x86_64.rpm                                           |  39 kB     00:00
(51/61): php-pspell-5.3.3-22.el6.x86_64.rpm                                            |  28 kB     00:00
(52/61): php-recode-5.3.3-22.el6.x86_64.rpm                                            |  25 kB     00:00
(53/61): php-snmp-5.3.3-22.el6.x86_64.rpm                                              |  30 kB     00:00
(54/61): php-soap-5.3.3-22.el6.x86_64.rpm                                              | 139 kB     00:01
(55/61): php-tidy-5.3.3-22.el6.x86_64.rpm                                              |  35 kB     00:00
(56/61): php-xml-5.3.3-22.el6.x86_64.rpm                                               | 103 kB     00:00
(57/61): php-xmlrpc-5.3.3-22.el6.x86_64.rpm                                            |  52 kB     00:00
(58/61): php-zts-5.3.3-22.el6.x86_64.rpm                                               | 1.2 MB     00:17
(59/61): postgresql-libs-8.4.13-1.el6_3.x86_64.rpm                                     | 200 kB     00:01
(60/61): recode-3.6-28.1.el6.x86_64.rpm                                                | 712 kB     00:06
(61/61): unixODBC-2.2.14-12.el6_3.x86_64.rpm                                           | 378 kB     00:02
--------------------------------------------------------------------------------------------------------------
Total                                                                          82 kB/s |  24 MB     04:56
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-common-5.3.3-22.el6.x86_64                                                            1/61
  Installing : php-pdo-5.3.3-22.el6.x86_64                                                               2/61
  Installing : apr-1.3.9-5.el6_2.x86_64                                                                  3/61
  Installing : apr-util-1.3.9-3.el6_0.1.x86_64                                                           4/61
  Installing : php-cli-5.3.3-22.el6.x86_64                                                               5/61
  Installing : 1:php-pear-1.9.4-4.el6.noarch                                                             6/61
  Installing : lm_sensors-libs-3.1.1-17.el6.x86_64                                                       7/61
  Installing : 1:net-snmp-libs-5.5-44.el6.x86_64                                                         8/61
  Installing : autoconf-2.63-5.1.el6.noarch                                                              9/61
  Installing : automake-1.11.1-4.el6.noarch                                                             10/61
  Installing : 1:net-snmp-5.5-44.el6.x86_64                                                             11/61
  Installing : php-pecl-apc-3.1.9-2.el6.x86_64                                                          12/61
  Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                     13/61
  Installing : httpd-tools-2.2.15-26.el6.centos.x86_64                                                  14/61
  Installing : libXau-1.0.6-4.el6.x86_64                                                                15/61
  Installing : libxcb-1.8.1-1.el6.x86_64                                                                16/61
  Installing : libX11-common-1.5.0-4.el6.noarch                                                         17/61
  Installing : libX11-1.5.0-4.el6.x86_64                                                                18/61
  Installing : libXpm-3.5.10-2.el6.x86_64                                                               19/61
  Installing : postgresql-libs-8.4.13-1.el6_3.x86_64                                                    20/61
  Installing : mailcap-2.1.31-2.el6.noarch                                                              21/61
  Installing : httpd-2.2.15-26.el6.centos.x86_64                                                        22/61
  Installing : php-5.3.3-22.el6.x86_64                                                                  23/61
  Installing : php-devel-5.3.3-22.el6.x86_64                                                            24/61
  Installing : 2:libpng-1.2.49-1.el6_2.x86_64                                                           25/61
  Installing : libxslt-1.1.26-2.el6_3.1.x86_64                                                          26/61
  Installing : libtool-ltdl-2.2.6-15.5.el6.x86_64                                                       27/61
  Installing : unixODBC-2.2.14-12.el6_3.x86_64                                                          28/61
  Installing : libicu-4.2.1-9.1.el6_2.x86_64                                                            29/61
  Installing : recode-3.6-28.1.el6.x86_64                                                               30/61
  Installing : libc-client-2007e-11.el6.x86_64                                                          31/61
  Installing : freetype-2.3.11-14.el6_3.1.x86_64                                                        32/61
  Installing : 12:aspell-0.60.6-12.el6.x86_64                                                           33/61
  Installing : libtidy-0.99.0-19.20070615.1.el6.x86_64                                                  34/61
  Installing : libjpeg-turbo-1.2.1-1.el6.x86_64                                                         35/61
  Installing : hunspell-1.2.8-16.el6.x86_64                                                             36/61
  Installing : 1:enchant-1.5.0-4.el6.x86_64                                                             37/61
  Installing : php-enchant-5.3.3-22.el6.x86_64                                                          38/61
  Installing : php-gd-5.3.3-22.el6.x86_64                                                               39/61
  Installing : php-tidy-5.3.3-22.el6.x86_64                                                             40/61
  Installing : php-pspell-5.3.3-22.el6.x86_64                                                           41/61
  Installing : php-imap-5.3.3-22.el6.x86_64                                                             42/61
  Installing : php-recode-5.3.3-22.el6.x86_64                                                           43/61
  Installing : php-intl-5.3.3-22.el6.x86_64                                                             44/61
  Installing : php-odbc-5.3.3-22.el6.x86_64                                                             45/61
  Installing : php-xml-5.3.3-22.el6.x86_64                                                              46/61
  Installing : php-pecl-apc-devel-3.1.9-2.el6.x86_64                                                    47/61
  Installing : php-zts-5.3.3-22.el6.x86_64                                                              48/61
  Installing : php-pgsql-5.3.3-22.el6.x86_64                                                            49/61
  Installing : php-snmp-5.3.3-22.el6.x86_64                                                             50/61
  Installing : php-pecl-memcache-3.0.5-4.el6.x86_64                                                     51/61
  Installing : php-mysql-5.3.3-22.el6.x86_64                                                            52/61
  Installing : php-bcmath-5.3.3-22.el6.x86_64                                                           53/61
  Installing : php-fpm-5.3.3-22.el6.x86_64                                                              54/61
  Installing : php-xmlrpc-5.3.3-22.el6.x86_64                                                           55/61
  Installing : php-dba-5.3.3-22.el6.x86_64                                                              56/61
  Installing : php-mbstring-5.3.3-22.el6.x86_64                                                         57/61
  Installing : php-ldap-5.3.3-22.el6.x86_64                                                             58/61
  Installing : php-process-5.3.3-22.el6.x86_64                                                          59/61
  Installing : php-soap-5.3.3-22.el6.x86_64                                                             60/61
  Installing : php-embedded-5.3.3-22.el6.x86_64                                                         61/61
  Verifying  : hunspell-1.2.8-16.el6.x86_64                                                              1/61
  Verifying  : httpd-2.2.15-26.el6.centos.x86_64                                                         2/61
  Verifying  : php-recode-5.3.3-22.el6.x86_64                                                            3/61
  Verifying  : libjpeg-turbo-1.2.1-1.el6.x86_64                                                          4/61
  Verifying  : libtidy-0.99.0-19.20070615.1.el6.x86_64                                                   5/61
  Verifying  : libxcb-1.8.1-1.el6.x86_64                                                                 6/61
  Verifying  : libXpm-3.5.10-2.el6.x86_64                                                                7/61
  Verifying  : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                      8/61
  Verifying  : php-pecl-memcache-3.0.5-4.el6.x86_64                                                      9/61
  Verifying  : 12:aspell-0.60.6-12.el6.x86_64                                                           10/61
  Verifying  : php-bcmath-5.3.3-22.el6.x86_64                                                           11/61
  Verifying  : php-fpm-5.3.3-22.el6.x86_64                                                              12/61
  Verifying  : php-devel-5.3.3-22.el6.x86_64                                                            13/61
  Verifying  : 1:php-pear-1.9.4-4.el6.noarch                                                            14/61
  Verifying  : php-pspell-5.3.3-22.el6.x86_64                                                           15/61
  Verifying  : php-xml-5.3.3-22.el6.x86_64                                                              16/61
  Verifying  : httpd-tools-2.2.15-26.el6.centos.x86_64                                                  17/61
  Verifying  : freetype-2.3.11-14.el6_3.1.x86_64                                                        18/61
  Verifying  : php-mysql-5.3.3-22.el6.x86_64                                                            19/61
  Verifying  : php-enchant-5.3.3-22.el6.x86_64                                                          20/61
  Verifying  : libX11-1.5.0-4.el6.x86_64                                                                21/61
  Verifying  : unixODBC-2.2.14-12.el6_3.x86_64                                                          22/61
  Verifying  : automake-1.11.1-4.el6.noarch                                                             23/61
  Verifying  : php-gd-5.3.3-22.el6.x86_64                                                               24/61
  Verifying  : apr-util-1.3.9-3.el6_0.1.x86_64                                                          25/61
  Verifying  : php-tidy-5.3.3-22.el6.x86_64                                                             26/61
  Verifying  : php-cli-5.3.3-22.el6.x86_64                                                              27/61
  Verifying  : libc-client-2007e-11.el6.x86_64                                                          28/61
  Verifying  : php-common-5.3.3-22.el6.x86_64                                                           29/61
  Verifying  : 1:enchant-1.5.0-4.el6.x86_64                                                             30/61
  Verifying  : recode-3.6-28.1.el6.x86_64                                                               31/61
  Verifying  : php-pecl-apc-3.1.9-2.el6.x86_64                                                          32/61
  Verifying  : libicu-4.2.1-9.1.el6_2.x86_64                                                            33/61
  Verifying  : autoconf-2.63-5.1.el6.noarch                                                             34/61
  Verifying  : libtool-ltdl-2.2.6-15.5.el6.x86_64                                                       35/61
  Verifying  : libxslt-1.1.26-2.el6_3.1.x86_64                                                          36/61
  Verifying  : 2:libpng-1.2.49-1.el6_2.x86_64                                                           37/61
  Verifying  : mailcap-2.1.31-2.el6.noarch                                                              38/61
  Verifying  : apr-1.3.9-5.el6_2.x86_64                                                                 39/61
  Verifying  : 1:net-snmp-5.5-44.el6.x86_64                                                             40/61
  Verifying  : php-xmlrpc-5.3.3-22.el6.x86_64                                                           41/61
  Verifying  : postgresql-libs-8.4.13-1.el6_3.x86_64                                                    42/61
  Verifying  : php-odbc-5.3.3-22.el6.x86_64                                                             43/61
  Verifying  : libX11-common-1.5.0-4.el6.noarch                                                         44/61
  Verifying  : php-imap-5.3.3-22.el6.x86_64                                                             45/61
  Verifying  : php-dba-5.3.3-22.el6.x86_64                                                              46/61
  Verifying  : php-mbstring-5.3.3-22.el6.x86_64                                                         47/61
  Verifying  : php-ldap-5.3.3-22.el6.x86_64                                                             48/61
  Verifying  : php-5.3.3-22.el6.x86_64                                                                  49/61
  Verifying  : php-pecl-apc-devel-3.1.9-2.el6.x86_64                                                    50/61
  Verifying  : 1:net-snmp-libs-5.5-44.el6.x86_64                                                        51/61
  Verifying  : php-pgsql-5.3.3-22.el6.x86_64                                                            52/61
  Verifying  : php-snmp-5.3.3-22.el6.x86_64                                                             53/61
  Verifying  : libXau-1.0.6-4.el6.x86_64                                                                54/61
  Verifying  : php-pdo-5.3.3-22.el6.x86_64                                                              55/61
  Verifying  : lm_sensors-libs-3.1.1-17.el6.x86_64                                                      56/61
  Verifying  : php-process-5.3.3-22.el6.x86_64                                                          57/61
  Verifying  : php-soap-5.3.3-22.el6.x86_64                                                             58/61
  Verifying  : php-embedded-5.3.3-22.el6.x86_64                                                         59/61
  Verifying  : php-intl-5.3.3-22.el6.x86_64                                                             60/61
  Verifying  : php-zts-5.3.3-22.el6.x86_64                                                              61/61

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

Dependency Installed:
  apr.x86_64 0:1.3.9-5.el6_2                           apr-util.x86_64 0:1.3.9-3.el6_0.1
  apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1               aspell.x86_64 12:0.60.6-12.el6
  autoconf.noarch 0:2.63-5.1.el6                       automake.noarch 0:1.11.1-4.el6
  enchant.x86_64 1:1.5.0-4.el6                         freetype.x86_64 0:2.3.11-14.el6_3.1
  httpd.x86_64 0:2.2.15-26.el6.centos                  httpd-tools.x86_64 0:2.2.15-26.el6.centos
  hunspell.x86_64 0:1.2.8-16.el6                       libX11.x86_64 0:1.5.0-4.el6
  libX11-common.noarch 0:1.5.0-4.el6                   libXau.x86_64 0:1.0.6-4.el6
  libXpm.x86_64 0:3.5.10-2.el6                         libc-client.x86_64 0:2007e-11.el6
  libicu.x86_64 0:4.2.1-9.1.el6_2                      libjpeg-turbo.x86_64 0:1.2.1-1.el6
  libpng.x86_64 2:1.2.49-1.el6_2                       libtidy.x86_64 0:0.99.0-19.20070615.1.el6
  libtool-ltdl.x86_64 0:2.2.6-15.5.el6                 libxcb.x86_64 0:1.8.1-1.el6
  libxslt.x86_64 0:1.1.26-2.el6_3.1                    lm_sensors-libs.x86_64 0:3.1.1-17.el6
  mailcap.noarch 0:2.1.31-2.el6                        net-snmp.x86_64 1:5.5-44.el6
  net-snmp-libs.x86_64 1:5.5-44.el6                    postgresql-libs.x86_64 0:8.4.13-1.el6_3
  recode.x86_64 0:3.6-28.1.el6                         unixODBC.x86_64 0:2.2.14-12.el6_3

Complete!

Step 3: Verify PHP Version and Installed Packages

[root@centos64 ~]# php -v
PHP 5.3.3 (cli) (built: Feb 22 2013 02:51:11)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
[root@centos64 ~]# rpm -qa | grep php
php-gd-5.3.3-22.el6.x86_64
php-pspell-5.3.3-22.el6.x86_64
php-recode-5.3.3-22.el6.x86_64
php-odbc-5.3.3-22.el6.x86_64
php-pecl-apc-devel-3.1.9-2.el6.x86_64
php-pgsql-5.3.3-22.el6.x86_64
php-pecl-memcache-3.0.5-4.el6.x86_64
php-bcmath-5.3.3-22.el6.x86_64
php-xmlrpc-5.3.3-22.el6.x86_64
php-mbstring-5.3.3-22.el6.x86_64
php-process-5.3.3-22.el6.x86_64
php-embedded-5.3.3-22.el6.x86_64
php-pdo-5.3.3-22.el6.x86_64
php-pear-1.9.4-4.el6.noarch
php-pecl-apc-3.1.9-2.el6.x86_64
php-devel-5.3.3-22.el6.x86_64
php-enchant-5.3.3-22.el6.x86_64
php-tidy-5.3.3-22.el6.x86_64
php-imap-5.3.3-22.el6.x86_64
php-intl-5.3.3-22.el6.x86_64
php-xml-5.3.3-22.el6.x86_64
php-zts-5.3.3-22.el6.x86_64
php-snmp-5.3.3-22.el6.x86_64
php-mysql-5.3.3-22.el6.x86_64
php-fpm-5.3.3-22.el6.x86_64
php-dba-5.3.3-22.el6.x86_64
php-ldap-5.3.3-22.el6.x86_64
php-soap-5.3.3-22.el6.x86_64
php-common-5.3.3-22.el6.x86_64
php-cli-5.3.3-22.el6.x86_64
php-5.3.3-22.el6.x86_64

Step 4: Configure PHP 5.3.3

Now that you have installed PHP 5.3.3, you will need to configure it for use with Apache. Open the php.ini file in your preferred text editor:

sudo vi /etc/php.ini

Find the following lines and uncomment them by removing the semicolon (;):

;cgi.fix_pathinfo=1
;date.timezone =

Set the timezone to your desired value, for example:

date.timezone = America/New_York

Increase PHP script memory limit:

memory_limit = 128M

Increase PHP script max execution time:

max_execution_time = 120

Increase PHP script max upload size :

upload_max_filesize = 50M

Save and close the file.

See also  How to Securing MySQL Database Server on CentOS 5.8

Step 5: Restart Apache

To apply the changes made in the previous step, restart Apache with the following command:

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

Commands Mentioned:

  • rpm – RPM Package Manager (used for installing the EPEL and Remi repositories)
  • yum – Yellowdog Updater Modified (used for installing PHP 5.3.3 and its extensions)
  • vi – Visual Editor (used for editing the php.ini file)
  • service – System V init script (used for restarting Apache)
See also  How to Setup Squid Proxy Service on CentOS 5.9

Conclusion:

In this guide, we have shown you how to install and configure PHP 5.3.3 on CentOS 6.4. By installing the EPEL and Remi repositories, installing PHP 5.3.3, configuring it for use with Apache, and restarting Apache, you should now have PHP 5.3.3 installed and working on your CentOS 6.4 server.

If you encounter any issues, please feel free to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *