How to use xampp for php

Xampp is full server package of to start working with the php. It contains the Apache, Mysql, PHP and Perl. For start PHP it is a good platform, it is quite easy to user and install. You can download download the xampp form it official website. For window you can download the .exe file of the xampp and after download by clicking the .exe file you can start installation.

This tutorial is the answer of all there questions:-

- How to use xampp for php?
- How to run xampp localhost?
- How to use xampp for php and mysql?
- How to use xampp mysql?
- How to use xampp to host a website?




Xampp installaion

1. Click the .exe file and instllation start.
2. Install the xampp in the drive where not your windows installed. (In case of window crash or reinstall you can loose your xmapp server php project files.)
3. For example my window is installed in the drive C so i installed the Xampp in the D: drive.
4. You can select also a folder/ directory for its installation.
5. If you only select the D drive then it will install the xampp in the directory xampp and the location will be D://xampp
6. After installation you will get the xampp control icon on your desktop.
7. If not get the xampp control icon on your desktop please got to the directory where you install the xampp and can get the control icon, from here you can copy the xampp-control.exe and can paste shortcut on your desktop or any other location.

8. Now after click on the xampp control icon a xampp window will open where you can start the Apache server and the MySql database to start the xampp for to work on PHP. If in case the Apache not start that can be cuse of the busy port, commonly the skype installed system not allow to start the Apache. For that case use sign-out skype and quit skype and try to start Apache again. There is another reson can the IIS running in the window you can stop the IIS and can try again to start IIS. Here is the view of the xampp control panel before start Apache and Mysql.



9. Xampp Control after start Apache and Mysql. As you can see Apache and MySql marked green it indicate the running successfully.


10. Now after start Xampp need to know where can crate the PHP files. Now you can create you php file in the D://xampp/htdocs directory. But it will be good if you create you own new directory inside the D://xampp/htdocs/my-project now the 'my-project' is my new PHP project inside the xampp server.


11. In the 'my-project' directory now you can create you php file. I am going to create a file withe name of the 'first-file.php'.



12. In you 'first-file.php' you can add you HTML and PHP code. Here i use a HTML tag h1 with some string and a PHP block <?php ?> printing some string using the echo.

<h1>First PHP File</h1>
<?php
echo "This is my first php file.";
?>


13. Now time to execute you php file and view the output of the PHP code. But question is how to execute and view you PHP file. It is quite very easy before view the output make sure your Apach and Mysql still running in side the xampp control panel. After just open any browser Chrome, miaill or safari etc. and enter this url htt;//localhost/my-project/first-file.php. As you hit this url in the address bar of your browser the php will execute on PHP compiler inside the xampp and will return the output in the form of the html text immediate browser will show this output.



14. Accessing MySql datbase using the xampp, use this url http://localhost/phpmyadmin and open in your browser and you will get the phpmyadmin running for you.



15. Here is the link of free online PHP course easy to learn and understand just click and proceed.



Students Tech Life