How to Setup PHP-Fusion on LAMP Stack Running on CentOS 7.x

Hi everyone, this tutorial is all about setting up PHP-Funsion on LAMP Stack running in CentOS 7 VPS or machine. PHP-Fusion is a lightweight open source content management system (CMS) written in PHP. It utilizes a MySQL database to store site content and includes a simple, yet comprehensive and complete administration system to manage sites. PHP-Fusion includes the most common features one would expect to see in many other content management system packages.

Here are the simple steps by which we can setup PHP-Fusion easily in on LAMP server running CentOS 7 Operating System.

1. Installing LAMP Stack

LAMP Stack includes Apache Web Server, MariaDB or MySQL and PHP Server. These servers are essential for us to setup PHP-Fusion. So, we'll need to install LAMP Stack on our CentOS 7 machine.

a) Installing Apache Web Server

First of all, we'll want to install Apache Web Server. We can install it by running the following command in a terminal or shell.

# yum install httpd

Installing httpd

Now, we'll also wanna start our Apache Web Server and enable it to startup in every boot.

# systemctl start httpd

# systemctl enable httpd

Enabling httpd server

b) Installing MariaDB

Now, after installing Apache Web Server, we'll wanna install MariaDB for our database manipulation.

# yum install mariadb mariadb-server

Installing MariaDB

After we finish installing MariaDB, we'll want to secure our database server and set a good strong root password that we can remember. To do so, run the following command.

# mysql_secure_installation

mysql secure installation

Then, go for set root password and follow the options below. You can also press Y and enter in the options to go for default options.

c) Installing PHP 5

Finally, we'll install PHP 5 in our CentOS machine to fulfill the LAMP Stack dependencies for our PHP-Fusion. We can install it by running the following command in a shell or terminal.

# yum install php php-mysql

Installing PHP

After installing PHP and MariaDB, we'll want to restart our Apache Web Server by running the following command.

# systemctl restart httpd

2. Configuring Apache Web Server

Now, we'll need to set up Apache virtual hosting directive for ‘’ domain name. So, we'll need to create a ‘/etc/httpd/conf.d/vhosts.conf’ file using a text editor with the command below.

# nano /etc/httpd/conf.d/vhosts.conf

Then, we'll want to add the following configuration in it.

IncludeOptional vhosts.d/*.conf

configuring vhosts config

We'll now create a ‘/etc/httpd/vhosts.d’ directory where we will put all our virtual hosts.

# mkdir /etc/httpd/vhosts.d

Then, we'll create a virtual host for our domain

# cd /etc/httpd/vhosts.d

# nano

and add the following content

<VirtualHost YOUR_SERVER_IP:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/html/"
ErrorLog "/var/log/httpd/"
CustomLog "/var/log/httpd/"
combined <Directory "/var/www/html/">
DirectoryIndex index.php
Options FollowSymLinks
AllowOverride All
Require all granted

configuring mysite

3. Creating Database

Now, we'll want to create a Database in MariaDB to store, retrieve and edit data for the PHP-Fusion. To create a database name, user and password, we'll need to run the following command in a terminal or shell.

# mysql -u root -p

> CREATE DATABASE phpfusion;
> GRANT ALL ON phpfusion.* to [email protected] identified by 'fusionpassword';

creating database

Note: Please replace fusion password with the required password you wanna set for the security purpose.

4. Installing PHP-Fusion

After creating our Database, we'll now finally install PHP-Fusion over our LAMP Stack. We'll first download the latest version of PHP-Fusion from it official download site.

We can directly download the latest and stable version ie 7.02.07 by running the following command in a shell or terminal.

# cd /tmp/

Downloading PHP-fusion

Now, we'll want to extract the downloaded Zip package using unzip command.

# unzip

Then, we'll create a directory where we'll keep PHP-Fusion and host our site. And then we'll move the extracted PHP-Fusion files to the hosting directory.

# mkdir /var/www/html/
# cp -R PHP-Fusion-7.02.07/files/* /var/www/html/

Extracting PHP-fusion

Now, we'll rename _config.php file to config.php by running the command below.

# cd /var/www/html/
# mv _config.php config.php

And finally, we'll change the owner of the PHP-Fusion files to apache.

chown -R apache:apache /var/www/html/

Configuring PHP-fusion files

5. Web Interface

Now, after installing Php-fusion via terminal, we'll now need to setup it in Web Interface ie. we'll need to open Php-fusion via our favorite web browser. The url depends upon our system's configuration as http://ip-address/ or .

Then, we'll see our first page as shown below. Then, we'll continue by selecting our language/locale and clicking Next.

php-fusion setting homepage

We'll need to keep clicking Next until we get into a Database configuration page. Here, we'll need to enter the configuration we had already created in mariadb in above steps.

Configuring Database on Web

Then, we should again keep clicking Next until the below page appears. Here, we'll configure the username and passwords for the administration of the site.

admin configuration

After everything is done, we'll be welcomed into our Php-fusion homepage.

php fusion homepage

6. Fixing Security Issues

After everything went fine, we'll now need to fix some security issues before we completely finish. We'll first need to remove setup.php and then fix file permission of config.php back to 644.

# rm -rf setup.php
# chmod 644 config.php

fixing security


Finally, we have successfully setup PHP-Fusion on our LAMP Stack running CentOS 7 Operating System. PHP-Fusion is an awesome Open Source CMS. It is simple, easy to manage and comprehensive Content Management System which is written of course in PHP. So, if you have any questions, suggestions, feedback please write them in the comment box below. Thank you ! Enjoy PHP-Fusion :-)

Arun Pyasi 6:00 am

About Arun Pyasi

Linux Enthusiast geek and Web Developer who loves Free and Open Source Software (FOSS). He is a FOSS activist who loves technology, hacking, blogging, travelling, research and development. He is the Founder/Lead Developer of Chitwanix OS.

Author Archive Page

Have anything to say?

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

All comments are subject to moderation.