Friday, 2 December 2022

How to set PHP Working Environment on Your PC?

Using XAMPP on Windows 

You should test PHP files on your computer when learning PHP;Running the PHP pages locally is the term for this.To do this you really want to introduce some product on your PC.When compared to attempting to create and edit files on a remote server managed by a hosting company, testing files locally takes much less time.

If your are new to PHP Please Visit this post first


Note: Personal Home Page Hypertext  Preprocessor

HOW TO INSTALL XAMPP ON WINDOWS

To install XAMPP on your PC go to: https://apachefriends.org and click on the XAMPP for Windows link.

The download will start automatically.



Once the download has completed, go to your Downloads folder and double-click on the installer to start the installation.


Follow the instructions to install XAMPP.


Precautions:As per my experience if you install XAMPP other than C: Drive you don't face any errors or problems when you run XAMPP Control Panel.

How To Start XAMPP ?

Click on Windows Start Button 



and then type XAMPP, You will see...


Click on XAMPP Control Panel, You will se the following Screen


Click on Start Button Next to Apache
Click on Start Button Next to MySql

If windows ask for permissions, please Allow the windows.

WHERE TO SAVE PHP FILES

  • Open Your favirout Editor, Create a New file, write some code inside this file (HTML, CSS, JAVASCRIPT, JQUERY, BOOTSTRAP, and moreover PHP code can be added to this file.
  • Save this file as sample.php in your XAMPP installation Drive, There you will find xampp folder, and inside xampp folder you will fine htdocs folder (this is the path to save all of your website files)
  • Now open your Chrome Browser.
  • Type localhost/sample.php in the address bar of Chrome Browser.

First Hello World PHP Program, Type the given below code to your Editor and save it with hello.php in the location told above.

Code:

<?php
echo "Hello World!";
?>




Now Test this file in the browser as described above



No comments:

Post a Comment