Which softwares are required?
You need to install the following three softwares to run php projects-
- Web server
- Database (ex. MySQL)
Where to install?
You can install PHP either of the following two-
- On web host or
- In your local computer
PHP installation on web host
As PHP is widely used scripting language and it is free, it is most likely that the web hosting plan you’re using has the web server installed on it already.
PHP installation on local computer
While developing PHP based websites; you want to run PHP in your local computer. So, you need to install it locally. You can install PHP on local system in two ways-
- All-in-one package installation (which is the easier solution)
- Separate Installation
- All-in-one package installation: For many beginners installing PHP separately seems intimidating. To help them get started quickly, there are some popular all-in-one packages. You don’t have to install and configure PHP, or Apache, or MySQL. ,Choose your package according to your operating system.
- WAMP: : If you’re using Windows, then you can use WAMP which is short for Windows, Apache, MySQL, and PHP. You can download WAMP from here www.wampserver.com/en/.
- MAMP: If you’re using MAC, then you can use MAMP which is short for MAC, Apache, MySQL, and PHP. You can download MAMP from here mamp.info/en/index.html.
- XAMPP: If you’re using Linux, then XAMPP is the installation package for you. ‘X’ in XAMPP stands for Linux, Windows, Mac OS X or Solaris. That means you can install XAMPP in any of operating system. You can download XAMPP from here www.apachefriends.org/en/xampp.html
- Separate installation: In case you’re confident of installing PHP separately, here are the downloads for you.
Testing the Installation:
To test your installation, write one of the two lines in web browser.
It will tell you whether the web server is running or not.
PHP file location on the server:
All the php files are stored in the web server’s root directory or sub directory within it. Depending on the different all-in-one packages that you’ve installed, here are the locations of the root directories-
- MAMP- Macintosh HD:Applications:MAMP:htdocs
- XAMPP- C:\xampp\htdocs
Note: Here it is assumed that you’ve installed the package in C drive.
|‹‹ PHP Introduction : Previous Lesson||Next Lesson: PHP Basic Syntax ››|