PHP Environment Setup

tutorial and example
tutorial and example

To install PHP, We have to installed AMP(Apache, MySQL and PHP) software. There are various AMP software available in the market.

  • XAMPP (Cross-Platform, Apache, MySQL, PHP and Perl) for windows.
  • WAMP (Windows, Apache, MySQL and PHP) for windows.
  • LAMP (Linux, Apache, MySQL and PHP) for Linux.
  • MAMP for Mac.
  • SAMP for Solaris.
  • FAMP for FreeBSD.

Note: In this tutorial, we are using XAMPP software. 

Follow these steps to run our PHP code.

  1. Download AMP (Apache, MySQL and PHP)software.
  2. Install it inside “C” drive.
  3. Open directory “C:\xampp\htdocs”.
  4. Create your own folder “phpfolder” inside the directory.
  5. Now, write your php code inside the phpfolder and save it with “index.php”
  6. Now open browser and write: “http://localhost/phpfolder/”.

Download AMP software.

You can download and Install server.

Double click to install.

You can install it inside the “C” drive.

Open your directory: “C:xampp/htdocs”.

Now, create “phpfolder” folderand save it inside the given above directory.

Write simple PHP Code.

Now,write a simple program and save it “index.php” inside the directory: C:\xampp\htdocs\phpfolder.

Open your Browser like Chrome, Firefox etc.

You can run your php code by writing given code in browser url:  http://localhost/phpfolder/.

 

Note: By default “index.php” page will be executed, when you call your project folder name.