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
Now, we'll also wanna start our Apache Web Server and enable it to startup in every boot.
# systemctl start httpd
# systemctl enable httpd
b) Installing MariaDB
Now, after installing Apache Web Server, we'll wanna install MariaDB for our database manipulation.
# yum install mariadb mariadb-server
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.
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
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 ‘mydomain.com’ 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.
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 mysite.com
and add the following content
ServerAdmin [email protected]
combined <Directory "/var/www/html/mysite.com/">
Require all granted
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';
> FLUSH PRIVILEGES;
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/
# wget http://downloads.sourceforge.net/project/php-fusion/PHP-Fusion%20Archives/7.x/PHP-Fusion-7.02.07.zip
Now, we'll want to extract the downloaded Zip package using unzip command.
# unzip PHP-Fusion-7.02.07.zip
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/mysite.com
# cp -R PHP-Fusion-7.02.07/files/* /var/www/html/mysite.com/
Now, we'll rename _config.php file to config.php by running the command below.
# cd /var/www/html/mysite.com/
# 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/mysite.com/
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/mysite.com or http://mysite.com/ .
Then, we'll see our first page as shown below. Then, we'll continue by selecting our language/locale and clicking Next.
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.
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.
After everything is done, we'll be welcomed into our 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
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 :-)