3

I have installed XAMPP server on my system to be able to use PHP. But after installation, when I run any php script on the browser it does not run. I do not see any ouput. No checking the phpinfo() from local host I see that version 5.3.5 is installed Even when running a a simple php file like where I echo a line;

I do not see anything on my browser. So, my question is do I need to make any configuration changes to my browser or system to get PHP running.

Hozefa
  • 1,676
  • 6
  • 22
  • 34
  • 5
    PHP scripts **never** run on the browser. – Ignacio Vazquez-Abrams Aug 23 '11 at 22:14
  • Look at the server's error log for reasons why PHP might not be running. – Marc B Aug 23 '11 at 22:15
  • Where's the script located on disk, and what's the URL you're trying to load in the browser? – bfavaretto Aug 23 '11 at 22:15
  • http://localhost/examples/Archive/test.php The php file is located under C:\xampp\tomcat\webapps\examples\Archive – Hozefa Aug 23 '11 at 22:18
  • @Ignacio [Not 100% true...](http://www.thomas-schilz.de/MozPHP/README.html) although I'm nit-picking there, in the real world it is absolutely true. – DaveRandom Aug 23 '11 at 22:22
  • @Hozefa, I see your posting a path to your tomcat configuration, make sure you're not confusing your Java web server with your Apache web server. I don't use XAMPP, so do excuse me if I'm wrong. – josef.van.niekerk Aug 23 '11 at 22:28
  • Even running a php file, to process a form does not yield required results. "; echo "Thank you for ordering from Tizag Art Supplies!"; ?> Running the above php file on submitting the html does not work. – Hozefa Aug 23 '11 at 22:29
  • `The php file is located under C:\xampp\tomcat\webapps\examples\Archive` Unless you already setting a virtual host (and/or vhost), then the default root is on `C:\xampp\htdocs` – toopay Aug 23 '11 at 22:34

5 Answers5

5

Put your scripts into /XAMPP/htdocs and then point your browser to: http://localhost/your_script.php

Spec
  • 329
  • 2
  • 14
1

Your best bet is taking a look at your log files, and perhaps turning error reporting on. Put a simple script in your webroot that simply echo's a string, for example:

<?php echo "Hello World!";

with the above there is very little that can go wrong. Work from there. Take a look at your phpinfo, and see where your log files are located. Search for

error_log

for the path to your PHP error log file and maybe see if

display_errors

is on.

This is something that has a multitude of possibilities that can be the cause of your problem.

josef.van.niekerk
  • 11,941
  • 20
  • 97
  • 157
0

install phpxx-php which is used for creating dynamic web sites

check version of php using php -v

if you have php55 then use:

yum install php55-php.x86_64
0

Ensure to save file as .php ; e.g. index.php and not index.html

Ivan_ug
  • 2,467
  • 2
  • 17
  • 18
-1

From Troublespy here are the reasons why php might not be working in the browser:

  1. You did not download a local server

  2. You are using the wrong version of php

  3. You put your scripts in the wrong directory

  4. You have a php error and the error didn't get printed

  5. Your php code is wrong or incomplete

Make sure you check all reasons.

picciano
  • 22,341
  • 9
  • 69
  • 82