How to Create a PHP File

Estudies4you
How to Create a PHP File

Creating a PHP File

After you have installed and configured Wampserver, you can start creating PHP files. To create a PHP file:
Open notepad and type the PHP script
Save the file with .php extension in C:\wamp\WWW or any folder i n this location.

Running a PHP File
There are two ways of running a PHP script.
  • To run a PHP script:
  • Open a browser and type localhost or 127.0.0.1. This opens the Wampserver configuration page which displays the list of projects
  • Browse and locate the directory that contains the required PHP file and double-click the required PHP file. This opens the PHP file and displays the output in the browser

You can also run a PHP directly by typing the URL in a browser. The syntax is:
http://localhost/<folder name>/<file-name>.php
(OR)
http://127.0.0.1/<folder name>/<file-name>.php

Example:
(OR)

To Top