Web Programming TutorialsEnvironmental set up for PHP

Environmental set up for PHP

In this session today we will study, how to download the xampp server which is required to run the php program. As php is an server side scripting language we need a server to execute the programs.

  • To setup up an environment for php follow the steps given below :

  1. Go to Google search and type the Apachefriend and then you will get the following links :
  2. v1

  3. Now click on the download link the next page will be displayed .
  4. v2

  5. Select the PHP version and click on the download button .
  6. The setup will get downloaded in your machine .
  7. v5

  8. Double click on the set up files. The next window will be displayed :
  9. v7

  10. Click on next you will get following window.
  11. v8

  12. After clicking on next it will ask for the installation path :
  13. v9

  14. Now again click on the next :
  15. v10

  16. Then again click on the next and you will have the following window :
  17. v11

  18. After clicking on next you will have the following downloading window as shown below :
  19. v12

  20. After the installation is complete the next window will appear:
  21. v13

  22. Now click on finished button.
  23. Open the Xampp Control panel window which will look like as shown below in the image that is xampp is successfully installed in your system:-
  24. vv1

    NOTE: If it shows an error message such as “Port 443 in use by Unable to open process with PID” under the xampp log panel as shown in below image :


    -It means that port 443 is been used by some other software in your system.Port 443 is used to process all the secure connection such as https request. For such instance we will change the port number in apache ssl config.
    Please note changing the port number is just for you to run the XAMPP on your desktop if it is used by any other software application.

    • So to get it solved just follow the steps given below :
    • -Go to the xampp installed directory> apache> config> extra folder, Open file called “httpd-ssl.conf” search for “Listen 443”.
    • Change port 443 to 444 and save the file.
    • -Restart apache server from XAMPP control panel.
    • -Now your XAMPP control panel should show

      17:33:45 [Apache] Attempting to start Apache service…
      17:33:50 [Apache] Status change detected: running

    • Yolla !! Apache server is up and running

  25. The xampp has multiple folder into the installation directory,which are shown below :-
  26. v23

  27. All the php programs are to be saved in the htdoc folder.
  28. The htdoc folder contain the following stuff:
  29. v24

  30. We can access the server in two methods: By entering in the browser window.
  31. v25

  32. Another way to access the server is entering the localhost in the browser window:-
  33. v26

  34. Now click on the English tab you will have the following window :
  35. v27

  36. Click on the security option as shown by the red arrow :
  37. security

  38. After clicking on the security option you will get the next window where you will find the following
    link : http://localhost/security/xamppsecurity.php just click on it :
  39. link

  40. Now here you can give password to your database ,it is the good practice to give password to your database.
  41. Similarly you can also provide password to your xampp directoy.
  42. v29

  • Now we are all set, so let’s create our first program in php :

  1. In xampp folder inside htdoc folder create a new folder say test :
  2. v30

  3. Inside that test folder create a new file called index.php and open it with notepad++ and write the following code in it.
  4. <?php
    echo "This is the first program";

  5. So you will have the following lookout of your notepad++ window after writing the code:-
  6. v31

  7. Open the Google Chrome browser inside it specify the url as http://localhost/test/index.php.
    This will call the test.php program which is saved in your htdoc folder.
  8. Note : Here test is the folder name and index.php is the filename.
  9. The output window look like as shown below :-
  10. v32

  11. Thus we have understood the step by step process for setting up an environment for php and also executed our first program on it.


Please enter your comment!
Please enter your name here

Exclusive content

- Advertisement -Newspaper WordPress Theme

Latest article


More article

- Advertisement -Newspaper WordPress Theme