@Pensu • 06 Apr, 2010 • 2 likes
I am learning PHP and oone of my has given me a software XAMPP which can run PHP scripts....but i dont know how to use it.So if anyone knows about it then plz tell me....
@Kaustubh Katdare • 06 Apr, 2010
nicepeeyush
I am learning PHP and oone of my has given me a software XAMPP which can run PHP scripts....but i dont know how to use it.So if anyone knows about it then plz tell me....
Using XAMPP is very easy. Follow these steps -

1. Run the XAMPP application. Turn on Apache & MySQL (if your application needs database) services through it.
2. Click on 'Explore' button on the XAMPP control panel - in the window that opens, check for htdocs folder.
3. htdocs folder is the one where all your PHP scripts should lie. This is the folder that Apache points to.
4. You might want to create a separate folder inside /htdocs/ folder to save all your PHP programs. Let's call it 'myprograms'.
5. Save your php script in /htdocs/myprograms folder. (Ex. test.php)
6. Now, start your webbrowser and type following address: https://localhost/myprograms/test.php

Your browser will now execute the script and show you the output.

I hope this works for you. If you have further questions, feel free to ask 😀
@Pensu • 07 Apr, 2010 Thanks Biggie...it worked....😀
@Anu18 • 15 Aug, 2011 I tried as biggie told..but im nt getting the o/p..its cming as 403 forbidden error
@Pensu • 15 Aug, 2011 403 forbidden error means that accessing to the file/folder you are trying to open has been denied. Misconfigurations and bad system or/and security and firewall settings can cause this error. Check this:

HTTP Error 403 Forbidden Explained
@Priyadharshini s • 31 Dec, 2011 Pensu ..thank you .. this helped me .
@Rajeev NR • 28 Mar, 2012 • 1 like hai,... i am Rajeev from Kerala(INDIA). i am a fresher in php development. i would like to study about php language. i dont know anything about php...i installed XAMPP from net. now i am studying php tutorials...please help me, how can i run a php program ?
@Kaustubh Katdare • 28 Mar, 2012 Rajeev NR : Read this post ->

The_Big_K
Using XAMPP is very easy. Follow these steps -

1. Run the XAMPP application. Turn on Apache & MySQL (if your application needs database) services through it.
2. Click on 'Explore' button on the XAMPP control panel - in the window that opens, check for htdocs folder.
3. htdocs folder is the one where all your PHP scripts should lie. This is the folder that Apache points to.
4. You might want to create a separate folder inside /htdocs/ folder to save all your PHP programs. Let's call it 'myprograms'.
5. Save your php script in /htdocs/myprograms folder. (Ex. test.php)
6. Now, start your webbrowser and type following address: https://localhost/myprograms/test.php

Your browser will now execute the script and show you the output.

I hope this works for you. If you have further questions, feel free to ask 😀
@Abhishek Swain • 28 Mar, 2012 • 1 like
Rajeev NR
hai,... i am Rajeev from Kerala(INDIA). i am a fresher in php development. i would like to study about php language. i dont know anything about php...i installed XAMPP from net. now i am studying php tutorials...please help me, how can i run a php program ?
I suggest you to go for WAMP SERVER. It's hassle free !
@Abhishek Swain • 28 Mar, 2012
Abhishek Swain
I suggest you to go for WAMP SERVER. It's hassle free !
As easy as 1-2-3
1) Install Wamp Server
2) Start Wamp Server using your Desktop icon.
3) Copy your project files to c:/wamp/www folder
4) Open your browser and type 127.0.0.1
5) Select your desired folder ffrom the project folders' list.

It's Done !
@Kaustubh Katdare • 28 Mar, 2012 WAMP and XAMPP both work almost the same way. Even XAMPP is easy to use; and I've never had any problems with it. The best thing about XAMPP is that they keep their package up to date with the latest versions of the web and database servers.

It's been long time since I used XAMPP though. Not aware of the latest developments. 😀
@Abhishek Swain • 28 Mar, 2012
The_Big_K
WAMP and XAMPP both work almost the same way. Even XAMPP is easy to use; and I've never had any problems with it. The best thing about XAMPP is that they keep their package up to date with the latest versions of the web and database servers.

It's been long time since I used XAMPP though. Not aware of the latest developments. 😀
Yes, even XAMPP is good. After all it depends on your choice. I have started my way with wamp server. So thought of suggesting others. 😁
@Rajeev NR • 30 Mar, 2012 thank you very much dear,..i will expect more helps in the future ....go may bless you
@emilydecker • 30 Mar, 2012 • 1 like hey! myself emily decker from london(UK). i am a developer in php, i like this news....good one
My Blog
@Programmist • 31 Mar, 2012 I don't know much about XAMPP but WAMP is way too easy to use in all ways for me😀 .
@PraveenKumar Purushothaman • 01 Apr, 2012 Actually XAMPP has more configuration options and will baffle the newbies and render it difficult to run... WAMP doesn't have much options and it is easy! 😀
@soumikdas22 • 06 Jun, 2012 sir i m having a difficulty with xampp .its showing 404 error ..
Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404

localhost
06/06/12 23:01:58
Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1



@PraveenKumar Purushothaman • 06 Jun, 2012 What URL did you enter? Try WAMP Server and let us know!
@soumikdas22 • 07 Jun, 2012
Praveen-Kumar
What URL did you enter? Try WAMP Server and let us know!
i am not sure what happened yesterday.. now it is working fine..
@iam12 • 18 Jun, 2012 What does error 404 mean?
@iam12 • 18 Jun, 2012
The_Big_K
Rajeev NR : Read this post ->
epic fail always get error 404
@PraveenKumar Purushothaman • 18 Jun, 2012
iam12
What does error 404 mean?
The 404 or Not Found error message is a HTTP standard response code indicating that the client was able to communicate with the server, but the server could not find what was requested.
@xheavenlyx • 28 Jun, 2012 I have written an updated tutorial on XAMPP installation and getting started with development. It's very basic and for anyone who would stumble on this thread:

https://www.crazyengineers.com/commu...b-development-environment-for-learning.55490/
@simiraj • 26 Jul, 2013 hi.. your description is very usaefull for me.,..... thank u
@atulmittal0109 • 10 Aug, 2013
Kaustubh Katdare
Using XAMPP is very easy. Follow these steps -

1. Run the XAMPP application. Turn on Apache & MySQL (if your application needs database) services through it.
2. Click on 'Explore' button on the XAMPP control panel - in the window that opens, check for htdocs folder.
3. htdocs folder is the one where all your PHP scripts should lie. This is the folder that Apache points to.
4. You might want to create a separate folder inside /htdocs/ folder to save all your PHP programs. Let's call it 'myprograms'.
5. Save your php script in /htdocs/myprograms folder. (Ex. test.php)
6. Now, start your webbrowser and type following address: https://localhost/myprograms/test.php

Your browser will now execute the script and show you the output.

I hope this works for you. If you have further questions, feel free to ask 😀
Hi Kaustabh,

I have tried that but when I run my file at https://localhost/myprograms/php_check.php
It is showing error as "Object not found". What may be the problem? I have followed exactly the above steps
@Kaustubh Katdare • 10 Aug, 2013 atulmittal0109 : Several things to know -

1. Does the file exist at /myprograms/ folder (physically) . That is check the htdocs folder and then go to 'myprograms' folder inside it and see if the file's there.

2. Is php_check.php error free?

3. Do other files in your document root work fine?
@atulmittal0109 • 10 Aug, 2013 Look, I installed the Xampp server and when installed, I started the control panel. After that, I turn on the Apache ans MySQL(though MySQL is not working for some reason). Now, I clicked on the explorer and in htdocs folder, I created a folder named as "myprograms" and then I created a file with name "php_check.php" in this folder. The code written in the file is as below:
(
<html>
<title>PHP Check File</title>
<body>
<?php
print "<h1>Congratulations, your server can process PHP!</h1>";
print "<h3>Here you can view the PHP configuration on your server</h3>";
phpinfo( );
exit();
?>
<h1>Sorry, PHP is not enabled on this server.</h1><br /><br />
<h3>Check your host provider documentation or contact
your host provider to ask them how to enable PHP.</h3>
</body>
</html>
)

Now, when I type the address in my browser as https://localhost/myprograms/php_check.php
it is still showing the same "object not found error"
@atulmittal0109 • 10 Aug, 2013 Hi,

I have got the solution. There was something wrong with the file extension. Thanks for your time and help.
@Kaustubh Katdare • 10 Aug, 2013 You don't need to put that file in the myprograms folder. If you just want to test whether XAMPP is working or not, you can put that file directly in htdocs folder and then access it from https://localhost/php_check.php . Also check if your browser can render any text file if you put it in htdocs folder and access it from https://localhost/<filename>.

If that doesn't work - your setup may have issues. Check whether XAMPP\apache\conf\httpd.conf is pointing to the right directory. Look for something that says "DocumentRoot".
@atulmittal0109 • 10 Aug, 2013 • 1 like Its working fine now both with php and text files. Thanks
@Nayan Goenka • 10 Aug, 2013 If you get struck at some errors and you think Xampp is working fine, try check your code for some missing tags. I had a recent experience when I screwed up some tags in the code that lead to malfunction. It was a stupid mistake and it was fixed easily but i had to waste a lot of time in to it.
@Tushar Kathuria • 10 Nov, 2013 I am also getting the same error 404.I entered url https://localhost/myprograms/test.php
Folder myprograms is saved in htdocs and test.php in myprograms.
please help me otherwise i will not even be able to start using php.
@Kaustubh Katdare • 10 Nov, 2013 @Tushar Kathuria - welcome to CrazyEngineers. Every setup is different; so we need to know what you've on your machine so that we can provide possible solutions.

You should perform quick checks-
  • Is your default XAMPP page loading fine?
  • If you put any text file say test.txt in /htdocs/ are you able to view it in browser by typing https://localhost/test.txt ?
Are you able to load other files in the same directory or in htdocs?
@Manish Goyal • 11 Nov, 2013
Tushar Kathuria
I am also getting the same error 404.I entered url https://localhost/myprograms/test.php
Folder myprograms is saved in htdocs and test.php in myprograms.
please help me otherwise i will not even be able to start using php.
Are you working on linux? on linux paths are case sensitive, so make sure directory name is exactly same as you are accessing on browser
@NIRAJ PANDEY • 08 Apr, 2014 I installed xampp on ma lappy..m newbie in php development..i tried to run php sript..bt browser dnt pops anythng inside php code...help
@Ankita Katdare • 08 Apr, 2014
NIRAJ PANDEY
I installed xampp on ma lappy..m newbie in php development..i tried to run php sript..bt browser dnt pops anythng inside php code...help
Share the exact steps you performed. That will help us know what went wrong. We will guide you from there.
@NIRAJ PANDEY • 08 Apr, 2014 apache is running..
<html>
<head>
<title>My first php</title>
</head>
<body>
<? echo "HIII!! IM NIRAJ PANDEY"; ?>
</body>
</html>
Dis is the script which i saved as test.php inside xampp\htdocs\nirajphp folder..
Then i opened chrome and typed https://localhost/nirajphp/test.php
title is displayed bt nothing is echoed..
@Ankita Katdare • 08 Apr, 2014 @NIRAJ PANDEY

To echo something, you can just write this code inside the test.php file.

<?php
echo "Hello World";
?>

That should work. 👍
@NIRAJ PANDEY • 08 Apr, 2014 tht worked thanxx..!! plzz cn u explain wat ws wrng in my code?
@Manish Goyal • 08 Apr, 2014 you were using short code <? ?> which might have disabled in your php.ini settings

For more info
https://www.php.net/manual/en/language.basic-syntax.phptags.php

Related Posts

I thought of compiling a list of the coolest and the best whatsapp group names that you've been using for your respective groups. For the sake of convenience, we'll stick...
A simple good bye email or last working day mail ain't cool! We've some awesome templates that you can use. If you're looking for an amazing Last Working Day email...
Hello CEans, How to convert CGPA (10 Point Scale) to Percentage? Please help!
I heard many students are having a trouble registering on the TCS Portal, when it's quite straightforward actually. If you have problem in attaching photos or CV, Use internet explorer...
What is IES or Indian Engineering Services Exam? Union Public Services Commission (UPSC) conducts the Engineering Services Exam or ESE 2016 is an entrance exam for graduates who wish to...