PHP not working

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

PHP not working

Postby viwen » 30. April 2009 04:07

Hi,

PHP just doesn't want to work for me. If I go to http://localhost and view the status it says it's activated. I can't get anything to display though when I open any files in the browser. For example, I tried doing...

Code: Select all
<?php

phpinfo();

?>

and I get a blank page. So obviously something's up.

I tried uninstalling and reinstalling XAMPP several times, but it hasn't fixed the problem. Any ideas?

Thanks in advance!
viwen
 
Posts: 2
Joined: 30. April 2009 03:43

Re: PHP not working

Postby Sharley » 30. April 2009 04:21

When you go to http://localhost in your browser and see the Status page these files are all php files.

You can't open a php file in a browser like in Explorer, you have to have it parsed by the server.

So in your case of the phpinfo() file if you named it phpinfo.php and you put this file in the htdocs folder then it has to be called in your browser like so - http://localhost/phpinfo.php

You can test this by going to the phpinfo() file included in XAMPP here - http://localhost/xampp/phpinfo.php
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: PHP not working

Postby viwen » 01. May 2009 01:56

That has it working now, but not if the files are saved in the htdocs folder which is how they had been. It tells me they can't be found. If I save them in the xampp folder they work perfectly. So I guess I'll just do that.

Thanks for your help!
viwen
 
Posts: 2
Joined: 30. April 2009 03:43

Re: PHP not working

Postby Sharley » 01. May 2009 02:35

viwen wrote:...but not if the files are saved in the htdocs folder which is how they had been. It tells me they can't be found.
Open xampp\apache\logs\error.log file in your text editor and see if there are any entries that explain why htdocs can't be found, I am curious about this issue - perhaps you might be kind enough to paste here the relevant entries please and thanks.
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


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 120 guests