just installed 1.7.4; PHP status Activated; .php load issue

Problems with the Windows version of XAMPP, questions, comments, and anything related.

just installed 1.7.4; PHP status Activated; .php load issue

Postby prob » 17. July 2011 00:11

- New to XAMPP and trying to learn php
- Just installed 1.7.4
- localhost Status shows PHP is ACTIVATED
- created file test.php and saved as C:/xampp/htdocs/testphp.php
- opened testphp.php in browser (Firefox 5.0)
- blank page is loading instead of "Test if php is working"

testphp.php code below

<html>
<head>
<title>Test PHP page</title>
</head>
<body>
<?php
$test = "Test if php is working";
echo $text ;
?>
</body>
</html>

Any suggestions would be very appreciated (apologizes if this has been addressed before - did a quick search but didn't find something applicable).
prob
 
Posts: 2
Joined: 16. July 2011 23:57

Re: just installed 1.7.4; PHP status Activated; .php load is

Postby Sharley » 17. July 2011 01:56

prob wrote:<?php
$test = "Test if php is working";
echo $text ;
?>
Perhaps you need to look closely at your code especially the difference between $text and $test.

Your current php code should produce a notice message in your browser if you typed http://localhost/test.php similar to this, if Apache and MySQL are running.:
Code: Select all
Notice: Undefined variable: text in C:\xampp\htdocs\test.php on line 3


Once the variable is corrected then you should see your response "Test if php is working" if Apache and MySQL are running.

You can test your XAMPP installation is working correctly by going to http://localhost in your browser and after selecting your language try and exercise all the demos in the left side menu.

Best wishes.
Last edited by Sharley on 17. July 2011 02:34, edited 1 time in total.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: just installed 1.7.4; PHP status Activated; .php load is

Postby prob » 17. July 2011 02:34

Thanks. I changed. That. Was not the issue. I checked on another forum and saw that you had to call the page from the url localhost\filename vs using File open...and doing that (plus your correction on the code) brought the page up...Appreciate the response.
prob
 
Posts: 2
Joined: 16. July 2011 23:57


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 95 guests