Getting Started with MySQL and PHP

This is going to be a tutorial in MySQL and PHP. I will respond to questions in the comments below. Let’s assume you have a computer. I have a computer also. Mine is a PC, but I’ve turned it into a Mac by following these simple steps:

Great, now that you have a Mac, let’s get started…

Ok, so if you couldn’t tell I was joking about how simple it is to set up a Hackintosh. It’s not that easy at all and maybe its grounds for a whole new tutorial, however I believe that has taken care of that pretty well.

I will likely rely throughout this site on Homebrew. Let’s install Homebrew.

Great, now that you have Homebrew, let’s install MySQL.

brew install mysql

Now, kick off your freshly installed MySQL server.

mysql.server start

Let’s say you have MacOS and you want PHP installed, lets not rely on the built in PHP server, instead, let’s do:

brew install php

I won’t go back and forth between Windows and Mac for all commands, but here is a resource info you use Windows:

And so yes, you need an actual web server. You see, PHP is just the scripting language that gets executed by a PHP interpreter. The web server is what actually serves the pages. What will we use? You guess it, Apache.

brew install httpd
sudo apachectl start

Open up your favorite browser

Go to: http://localhost:8080

Apache’s default landing page

Next time we will continue with getting your first PHP page up and running.

3 thoughts on “Getting Started with MySQL and PHP

Leave a Reply