Page 1 of 1

PHP not working

PostPosted: 30. April 2009 04:07
by viwen
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!

Re: PHP not working

PostPosted: 30. April 2009 04:21
by Sharley
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

Re: PHP not working

PostPosted: 01. May 2009 01:56
by viwen
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!

Re: PHP not working

PostPosted: 01. May 2009 02:35
by Sharley
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.