Wordpress is the best content management system written in the PHP programming language, and it uses MySQL for the database management system. Friendly features that allow you to build your theme with unlimited plugins to let your idea come true has made the most popular CMS on the world. WordPress is easy to use, fast, and secure for your website.
In this article, we will explain How To Install WordPress with LAMP Stack on CentOS 7.
Before you begin, you will need:
Step 1 - Download WordPress
After you have successfully installed LAMP Stack based on the article above, change current directory to web directory:
Now download the latest WordPress file by running this command:
Next, extract the WordPress file in the current directory:
tar xvzf latest.tar.gz
After, you need to move files from wordpress directory into web directory:
mv /var/www/html/wordpress/* /var/www/html
Step 2 - Create a MySQL database
You will need a database to store, collect, and retrieve website information. Now we need to create a MySQL database. First login to MySQL:
mysql -u root -p
Enter the password, and create a database name:
CREATE DATABASE wordpress;
After, grant privileges on the database name, create a database user, and set password:
GRANT ALL PRIVILEGES on wordpress.* to 'wordpress_user'@'localhost' identified by 'wordpress_pw';
Flush privileges to make changes.
And log out from MySQL:
You have successfully created a database for your WordPress site. Now, change the WordPress configuration file with the database that you created. First, rename wp-config-sample.php to wp-config.php:
mv wp-config-sample.php wp-config.php
Open wp-config.php file:
Change lines in red: With the database that you created above: Close file by pressing CTRL+X, type Y to save changes and hit Enter.
Step 3 - Install PHP 7
If you have followed the article in Prerequisites section, you will need to update your PHP to 7.0 or later. To update you will need to install Remi and Epel repositories:
yum install epel-release yum-utils -y yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Now enable PHP 7.0 repo:
yum-config-manager --enable remi-php70
And install PHP 7.0 with msyql module:
yum install php php-mysql
Restart the webserver to take changes:
systemctl restart httpd
Step 4 - WordPress installation
Once you have successfully followed this article, open browser and go to http://yourdomain.com or http://youripaddress. After you have gone to your site, you will get the famous five-minute installation process: Provide the information below by your preferences and click on the Install WordPress button to finish the installation process: Now, log in to your WP Admin Panel: And manage your WordPress site:
You have successfully installed WordPress with LAMP Stack on CentOS 7. Now you have created your website, and you can design it for your wishes.