How to Create a Local Server With a Database and Connect Wordpress
by MArianna_TT in Workshop > Science
322 Views, 0 Favorites, 0 Comments
How to Create a Local Server With a Database and Connect Wordpress
A local server is a program that gives the opportunity to upload a website or an eshop for free for educational, implementation, portofolio, etc purposes. There are two worldwide known servers you can download for free, xampp and wamp. Both of these local servers offers a suitable environment to test and verify the working of projects based on Apache, Perl, MySQL database, and PHP through the system of the host itself. Among these technologies, Perl is a programming language used for web development, PHP is a backend scripting language, and MariaDB is the most vividly used database developed by MySQL. The most common and easiest platform you can use for web pages is Wordpress, also there are two well known other platforms Joomla and Drupal. Based on your requirements of your project that you are planning to implement, you can choose the proper platform to develop it.
Download and Open Installer Xampp
First search for the official site to download xampp server installer : https://www.apachefriends.org/download.html
Choose to download the installer for windows either for linux depending your operating system you use.
While the installer is downloading, choose a specific location on your local disk drive to make a folder for the installation. It is recommended to choose another local disk from C:/ (usually OS is installed there) if you have already installed another database setup in your pc, to avoid any conflicts may occur. Otherwise if you don't have any other vendor of database already installed at your pc, go ahead and install the xampp server to the default destination folder it propose which is C:/.
Installation of Xampp Server and Test If It Works Properly
This collection of xampp software contains a web server named Apache, a database management system named MariaDB and scripting/programming languages such as PHP and Perl. Other components are also part of this collection of software and are explained below.
1. Apache: It is an HTTP cross-platform web server. It is used worldwide for delivering web content. The remote server of Apache delivers the requested files, images, and other documents to the user.
2. MariaDB: Originally, MySQL DBMS was a part of XAMPP, but now it has been replaced by MariaDB. It is one of the most widely used relational DBMS, developed by MySQL. It offers online services of data storage, manipulation, retrieval, arrangement, and deletion.
3. PHP: It is the backend scripting language primarily used for web development. PHP allows users to create dynamic websites and applications. It can be installed on every platform and supports a variety of database management systems. It was implemented using C language. PHP stands for Hypertext Processor. It is said to be derived from Personal Home Page tools, which explains its simplicity and functionality.
4. Perl: It is a combination of two high-level dynamic languages, namely Perl 5 and Perl 6. Perl can be applied for finding solutions for problems based on system administration, web development, and networking. Perl allows its users to program dynamic web applications. It is very flexible and robust.
5. phpMyAdmin: It is a tool used for dealing with MariaDB.
6. XAMPP Control Panel: It is a panel that helps to operate and regulate upon other components of the XAMPP.
7. Webalizer: It is a Web Analytics software solution used for User logs and provide details about the usage.
That is all you need for your projects, so uncheck any boxes it is unnecessary.
I have already installed Mysql database on my pc, so I have changed my installation destination folder.
Finish the install and let it open the xampp control panel. Press the start button on apache and Mysql to check if it connects without any problem. Press also button Admin at Mysql and it will open the database on your default browser.
As you can see the apache is running at port 80 and Mysql is running at port 3306. That's important things you must know because many connection problems occurs because of port conflicts with other apps. In a later step I am gonna explain some steps you can make to fix some problems may occur.
Download and Connect Wordpress
Go to the official Wordpress web page and download the last version of Wordpress : https://wordpress.org/download/. It is gonna be a zip file.
Go to the xampp folder you made or the default folder xammp created - C:/xampp - browse to htdocs and created a new folder. Name that folder as the site or your eshop gonna be named. I named it jewelshop, because it's gonna be a jewelry eshop. So my path is D:/xampp_server/htdocs/jewelshop.
Now extract all files from the Wordpress installation folder to your new folder, mine jewelshop.
Wordpress needs a database to connect, we must create it.
Open xampp control panel and press the button Admin at Mysql field. It will pop up the database software on your default browser. Press Database to create a new. Name the database preferably as your site or eshop.
Now you are ready to install Wordpress. As your default browser is opened, type in a new web page : localhost/jewelshop. Localhost is your local server and jewelshop is your subname as you called it.
It will load the setup installation of Wordpress.
Wordpress Installation
As we mentioned earlier we need to connect a database with Wordpress in order to run. So we have already created one called same as our site name jewelshop. If you named it else and you don't remember exactly the name, you can just go to xampp control panel and press admin at Mysql field. You are gonna be called to set a Database Admin User and a password.
Step 5 : Table prefix.
This field is something you preferably DON'T want to change. It causes many problems with the connection between apache and Wordpress.
Some Extra Knowledge for Debugging
1. You can change your default browser into another. Just open xampp control panel and press Config. There you can change the editor and the default browser path.
DON'T change the editor !! Never, it causes many problems, you can fix them but don't trouble yourself with that.
The xampp has a bug, when you close the application it forgets the path for the browser, you must change it everyday when you start the application.
2. If you have already installed a database system except xampps database system, you are gonna face problems with user privileges and files that don't open. You can solve this by opening the app as administrator or change the privileges. Go to your xampp server location folder and search for a file called xampp-control.ini (scroll down, probably it's the last one as mine). Right click on it and go to properties. Change the Everyone (users privileges) only read and give full control.
3. For debugging you can either go to xampp folder files either open some basic files from xampp control panel by pressing apache - Config - or Mysql - Config - .
apache -> config -> phpmyadmin : You can change the root password and the username of the user and set the password you may set from the database setup, when you made a new user.
Mysql -> config -> my.ini : You can change the port of the database connection 3306
If you have already installed another database, both databases operates at the same port, that causes a conflict.