How to run php programs in your computer system

 How to run Php programs in your computer system:-

As we know that PHP is a server-side scripting language, which is used with HTML, CSS, and javascript.

To run the PHP files we need to run a web server(apache) in our system.

Php files can be recognized by the .php extension.

How to run a web server

First, we need to install the server or you can download the XAMPP or Wamp server.

The goal of XAMPP and WAMP is to build an easy-to-install distribution for developers to get into the world of Apache.

To make it convenient for developers, XAMPP is configured with all features turned on.



To install XAMPP click here

How to run PHP files

1] The First step is installing the XAMPP server.

2] Now open the Xampp control panel by searching it.

3] After opening the control panel, it will look like this-



4]Click the start button of Apache. If you want to connect your    database you can also start MySql.



4] Now minimize this window and open the folder where you install XAMPP

follow/open this directory:-

C: -> xampp -> htdocs 

5] Now create a folder at this location and create an index.php file, you can change the name, and write your PHP programs in this file.

6]To run the file just write this URL in chrome and search-

I have created the folder myPhp in htdocs folder.

                    http://localhost/myPhp/index.php

If you have only one PHP file so you nee to write only the folder name like this-

                     http://localhost/myPhp

Here you can see my output:-


Where we can write PHP programs:-

You can write Php code in Visual Studio or any other text editor like notepad.
But all you need to do that just save that files with the .php extension.



















Post a Comment

0 Comments