How to Install MySQL 5.6, PHP 5.6, and WordPress 3.9 on CentOS 6

This step‑by‑step guide shows how to install MySQL 5.6, set up PHP 5.6 with Apache, and configure WordPress 3.9 on a CentOS 6 server, including database creation, wp‑config adjustments, and final file permissions.

Full-Stack DevOps & Kubernetes
Full-Stack DevOps & Kubernetes
Full-Stack DevOps & Kubernetes
How to Install MySQL 5.6, PHP 5.6, and WordPress 3.9 on CentOS 6

Install MySQL 5.6

Remove any previously installed MySQL packages to avoid version conflicts: yum remove mysql* -y Add the official MySQL community repository for CentOS 6:

rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

Install the MySQL server package: yum install mysql-server -y Configure InnoDB to use a separate file per table (improves performance and simplifies backup). Edit /etc/my.cnf and add the following under the [mysqld] section:

[mysqld]
innodb_file_per_table

Start the MySQL service and run the security script to set a root password and remove default insecure settings:

service mysqld start
mysql_secure_installation

Verify the installation by logging in with the root account:

mysql -uroot -p

Install Apache, PHP 5.6 and required extensions

Enable the Webtatic repository, which provides PHP 5.6 packages for CentOS 6:

rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm

Install Apache (httpd) and PHP 5.6 together with the most common extensions needed by WordPress:

yum install httpd php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap -y

Start the Apache HTTP service and enable it to start on boot (optional):

service httpd start
chkconfig httpd on

Install WordPress 3.9 (Chinese language pack)

Extract the WordPress archive: unzip wordpress-3.9-zh_CN.zip Create a dedicated MySQL database and user for WordPress. Replace wordpress and the password with values of your choice:

mysql -uroot -p
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY 'wordpress';
FLUSH PRIVILEGES;

Prepare the WordPress configuration file:

cd wordpress
cp wp-config-sample.php wp-config.php
vim wp-config.php

Inside wp-config.php replace the placeholder constants with the database credentials you created:

define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpress');
define('DB_PASSWORD', 'wordpress');
define('DB_HOST', 'localhost');

Copy the WordPress files to Apache's document root and adjust ownership so that the apache user can read/write as needed:

cp -r . /var/www/html/wordpress
chown -R apache.apache /var/www/html/wordpress

Open a web browser and navigate to the server's address (replace the IP with your own) to complete the web‑based setup wizard:

http://<em>YOUR_SERVER_IP</em>/wordpress
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

mysqlPHPInstallationApacheCentOSWordPress
Full-Stack DevOps & Kubernetes
Written by

Full-Stack DevOps & Kubernetes

Focused on sharing DevOps, Kubernetes, Linux, Docker, Istio, microservices, Spring Cloud, Python, Go, databases, Nginx, Tomcat, cloud computing, and related technologies.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.