Hozefa
Hozefa

Reputation: 1726

PHP script not running on browser

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.

Upvotes: 3

Views: 24815

Answers (5)

Ivan_ug
Ivan_ug

Reputation: 2625

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

Upvotes: 0

Kester Ross
Kester Ross

Reputation: 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.

Upvotes: -1

Bhavesh Patel
Bhavesh Patel

Reputation: 9

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

Upvotes: 0

Spec
Spec

Reputation: 329

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

Upvotes: 5

josef.van.niekerk
josef.van.niekerk

Reputation: 12121

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.

Upvotes: 1

Related Questions