To install PHP, We have to installed AMP(Apache, MySQL and PHP) software. There are various AMP software available in the market.
Note: In this tutorial, we are using XAMPP software.
- 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.
Follow these steps to run our PHP code.
Download AMP software.
- Download AMP (Apache, MySQL and PHP)software.
- Install it inside “C” drive.
- Open directory “C:\xampp\htdocs”.
- Create your own folder “phpfolder” inside the directory.
- Now, write your php code inside the phpfolder and save it with “index.php”
- Now open browser and write: “http://localhost/phpfolder/”.
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/.
By default “index.php”
page will be executed, when you call your project folder name.