Install Apache/PHP 5.5.7, MariaDB 5.5.34 on CentOS 6.5

This howto guide explains you’ll how to install Apache Server with latest MariaDB 5.5.34 and PHP 5.5.7 versions on CentOS 6.5 systems using Remi repository via Yum tool.

We are going to install all these following PHP modules in this installation.

  • APC (php-pecl-apc) – APC caches and optimizes PHP intermediate code
  • CLI (php-cli) – Command-line interface for PHP
  • PEAR (php-pear) – PHP Extension and Application Repository framework
  • PDO (php-pdo) – A database access abstraction module for PHP applications
  • MySQL (php-mysqlnd) – A module for PHP applications that use MySQL databases
  • PostgreSQL (php-pgsql) – A PostgreSQL database module for PHP
  • MongoDB (php-pecl-mongo) – PHP MongoDB database driver
  • SQLite (php-sqlite) – Extension for the SQLite V2 Embeddable SQL Database Engine
  • Memcache (php-pecl-memcache) – Extension to work with the Memcached caching daemon
  • Memcached (php-pecl-memcached) – Extension to work with the Memcached caching daemon
  • GD (php-gd) – A module for PHP applications for using the gd graphics library
  • XML (php-xml) – A module for PHP applications which use XML
  • MBString (php-mbstring) – A module for PHP applications which need multi-byte string handling
  • MCrypt (php-mcrypt) – Standard PHP module provides mcrypt library support

Install REMI repository

First enable remi repository

## Install Remi on CentOS 6.5 - 32 Bit ##
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 

## Install Remi on CentOS 6.5 - 64 Bit ##
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Installing MariaDB 5.5.34

We highly recommended to use custom MariaDB YUM repository to install. Create a repo file under/etc/yum.repos.d/MariaDB.repo, Copy and paste following line under MariaDB repo:

Add repository on Centos 6 32-bit

# vi /etc/yum.repos.d/MariaDB.repo

and paste following line:

name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-x86

Add repository on Centos 6 64-bit

name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64

Once you’ve placed MariaDB.repo file under /etc/yum.repos.d/. Let’s install with following YUM command:

# yum install MariaDB-server MariaDB-client -y

After complite installation process, start MariaDB width following command:

# service mysql start

Set MariaDB to start on boot:

# chkconfig mysql on

Read also: How to install MariaDB 5.5.33a Database on RHEL/CentOS/Fedora and Debian/Ubuntu linux

Install Apache HTTP Server (httpd) and PHP 5.5.7

# yum --enablerepo=remi,remi-php55 install httpd php php-common

Install PHP 5.5.7 modules

Select what you need: APC, CLI, PEAR, PDO, MySQL, PostgreSQL, MongoDB, SQLite, Memcache, Memcached, GD, MBString, MCrypt, XML

# yum --enablerepo=remi,remi-php55 install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml

Start Apache server (httpd) and autostart Apache server (httpd) on boot

# service httpd start
# chkconfig httpd on

Create test PHP page to check that Apache, PHP and PHP modules are working

# vi /var/www/html/info.php

and paste following code:


Check created page with browser

Access following address, with your browser. http://ip.add.re.ss/info.php

PHP 5.5.7 Preview
PHP 5.5.7 Preview

That’s it!. If you are having any trouble installing, let me know via our comment section.


  1. My info.php does not show up.

    Not Found

    The requested URL /info.php was not found on this server.

    Apache/2.2.15 (CentOS) Server at Port 80

      1. yes and put it in the following path /var/www/html still doesn’t show up.

        I am trying to get apache, php5, mysql, and wordpress all installed, configured, and working correctly. Because I am a novice, I read, I understand as best as I can, and try the instructions. I did, however, get the wordpress folder extracted to the /var/www/html folder and I now get wordpress but a connection error (see screenshot). This is so bumfuzzling I’m not sure if I have messed up something or not

  2. Hi, Thanks for the info. Remi’s repo had a dependency on EPEL, so I had to setup that repo first.

Leave a Reply

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


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button