Now it's time to set up a development environment.
You could rent some server space, or maybe you already have a website. If so, it very likely has a database attached to it. Not only that, it probably has the same tool called phpMyAdmin that we are going to use in this class. If you have phpMyAdmin you can skip ahead to the next lesson.
Nonetheless, it's always good to have a development environment that runs locally on your own computer. That way, you can develop and test a site and not have it accessible to the web.
If you are on a PC, install WAMP.
If you are on a Mac, install MAMP.
If you are on either, install XAMPP.
See the installation instructions below.
XAMPP, like WAMP or MAMP, is a bundle of software that includes:
A web server, so you can serve web pages on your own computer in the same way that a web web page on the internet is processed.
A relational database - so you can store content that your web pages can query.
A few programming languages - so you can write code that gets processed and turned into HTML.
XAMPP used to come with MySQL (pronounced My S.Q.L). Now it comes with MariaDB. MariaDB is the open source version of the MySQL.
You could install the database, the language, and the webserver separately. Xampp is just a bit quicker than doing that.
Go to https://www.apachefriends.org/index.html and download the XAMPP package that is right for your operating system.
If you are on a Windows computer, go to this guide:
To install XAMPP on a Mac, go here:
https://www.apachefriends.org/download.html I've installed version version 5.6.28 / PHP 5.6.28.
Go To Application. In the top of your screen you'll see three tabs: Welcome, Manage Servers, and Application Log. Click the Manage Servers tab and then start MySQL.
It needs admin privileges, so give it the system's password. Then, start the MySQL database.
If you are on a Mac and the database doesn't start you may need to open a Terminal window and type this command:
sudo killall mysqld
(As it is a sudo command, the computer will ask you for you admin password.)
Next, start MySQL.
If it still won't start, you may need to run another command in the Terminal. Start Terminal, then run this command:
sudo apachectl stop
Now if you go to a browser and type localhost, you should get the XAMPP homepage!
Download and install a text editor
I like Sublime Text, which you can download at https://www.sublimetext.com/. It's a simple-to-use editor that many developers love, and even better, it's free! You can try it out with a trial version.
On the top right of the homepage is a link to phpMyAdmin which is the Graphical User Interface (GUI) for the database.
To understand what a GUI is, let's look at what its not! When you run a command in Terminal window, like some of you just did, you are typing a command. With a GUI, you click a button or fill in a field.
Advanced database programmers will often scoff at using a GUI for setting up a databases. They probably set them up from the command line and have all the database commands memorized. However, databases and most software is much more approachable when you have an interface to guide you along. phpMyAdmin is a GUI for MySQL, so let's check it out!