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 :
- Go to Google search and type the Apachefriend and then you will get the following links :
- Now click on the download link the next page will be displayed .
- Select the PHP version and click on the download button .
- The setup will get downloaded in your machine .
- Double click on the set up files. The next window will be displayed :
- Click on next you will get following window.
- After clicking on next it will ask for the installation path :
- Now again click on the next :
- Then again click on the next and you will have the following window :
- After clicking on next you will have the following downloading window as shown below :
- After the installation is complete the next window will appear:
- Now click on finished button.
- 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:-
- 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
- The xampp has multiple folder into the installation directory,which are shown below :-
- All the php programs are to be saved in the htdoc folder.
- The htdoc folder contain the following stuff:
- We can access the server in two methods: By entering 127.0.0.1 in the browser window.
- Another way to access the server is entering the localhost in the browser window:-
- Now click on the English tab you will have the following window :
- Click on the security option as shown by the red arrow :
- 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 : - Now here you can give password to your database ,it is the good practice to give password to your database.
- Similarly you can also provide password to your xampp directoy.
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.
- Now we are all set, so let’s create our first program in php :
- In xampp folder inside htdoc folder create a new folder say test :
- Inside that test folder create a new file called index.php and open it with notepad++ and write the following code in it.
- So you will have the following lookout of your notepad++ window after writing the code:-
- 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. - Note : Here test is the folder name and index.php is the filename.
- The output window look like as shown below :-
- Thus we have understood the step by step process for setting up an environment for php and also executed our first program on it.
<?php echo "This is the first program"; ?>