PHP Installation

What do you need to run PHP on your computer, and how to set up a WAMP server, it is explained in this tutorial.

What You Need to Run PHP

To run PHP code, you need the following three software on your local machine:
  1. Web Server (e.g., Apache)
  2. PHP (Interpreter)
  3. MySQL Databases (optional)

You can separately install Web Server, PHP Interpreter, and MySQL databases, but to make work easier, developers have made all in one setup package called WAMP, LAMP, MAMP and XAMPP which will automatically install and set up PHP environment on your Windows, Linux or MAC machines.

  • WAMP (Windows, Apache, MySQL, PHP)
  • LAMP (Linux, Apache, MySQL, PHP)
  • MAMP (MAC, Apache, MySQL, PHP)
  • XAMPP (Windows/Linux/MAC, Apache, MySQL, PHP)

Start Where?

To execute PHP code, you need access to a web server in which PHP is running.

Your main options are:

  • Install Apache and PHP or Install WAMP, LAMP, MAMP or XAMPP according to your OS.
  • After installation, you need to run and start the Apache Server and PHP from your program list, and then type http://localhost in your web browser for a start working.
  • In the Apache installation folder, you will find the www folder, where you can save PHP files, and you can also create your project folder inside the www folder.

or

  • Find a web hosting plan with Apache, PHP, and MySQL support and Run your PHP scripts on your Web host.

or

Installing WAMP Server

Creating the Script

You need to use a text editor program to write your code.  All OS come with one or more text editors, for example:

  • Windows Notepad
  • Vi or Emacs on Linux
  • TextEdit on Mac OS X

Commercially, Adobe Dreamweaver,  NetBeans, and Sublime Text are used to edit PHP code.


Here are few other related articles for you to read:

Scroll Back to Top