Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hii ,

I am a beginner in PHP .I would like to know how one can execute a PHP script using XAMPP server ... ??

Any suggestions ... :)

share|improve this question

closed as off topic by mdpc, RobM, voretaq7 Jan 22 '13 at 23:43

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Assuming Windows:

Navigate to your "localhost" folder (usally): C:\xampp\htdocs

Create a new folder called "ravi", and inside that folder create a file called: index.php

Put all your PHP code in that index.php file and save the file.

Then, after starting XAMPP, navigate to: http://localhost/ravi/

And you'll see your script running.


share|improve this answer

Of course your index.php should follow the php rules. For example your code has to start with


and end with ?>

You can use this tutorial to get some information regarding php how-to

share|improve this answer

1) Open the XAMPP Control Panel from the start menu.
2) To the right of where it says "Apache" click 'Start' button.
3) On the right side of the screen, click the 'Explore' button.
4) Open the "htdocs" folder. This will be your working directory where you put your php files.
5) As a test, make a new file called "hello.php" and put the following code in it:

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

6) Now in your browser (Firefox, Chrome, Internet Explorer, etc.) go to either of the following two links to run your PHP script from step 5:
share|improve this answer

I am new to PhP and as mentioned by you above i tried the same process but still i am not able to see the output, in fact i am getting the following error. Could anyone look it and help me in solving my problem.

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 Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7

share|improve this answer
Your answer might be better addressed as a simple comment. – mdpc Jan 22 '13 at 21:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.