Page 1 of 1

PHP Doesn't Work

PostPosted: 09. December 2009 06:48
by Jenathan777
Hello, I have installed xampp for Windows 1.7.1.

When I use the xammp control page phpinfo button i get the result from Apache of the correct page.
When I insert this into a web page i.e index.php for a new default server page I don't get a result. :cry:

Can anyone help me with this? Is there some missing code to get PHP to work?

<!DOCTYPE html> <!-- HTML 5 -->
<html>

<head>
normal head section meta and link statements
</head>

<body>
some text
<?php
echo phpinfo();
?>
</body>
</html>

Re: PHP Doesn't Work

PostPosted: 09. December 2009 07:42
by Stepke-DSL
Where did you save the file and how do you navigate to the file in your browser?

Re: PHP Doesn't Work

PostPosted: 09. December 2009 07:44
by Bill Smith
Stepke and I are on the same track.

Did you type "http://localhost/index.php" in your browser window? If you simply doubleclicked the index.php document, then your browser would try to display it without running it through/on your Apache server.

Re: PHP Doesn't Work

PostPosted: 09. December 2009 07:51
by Altrea
Hi.

Jenathan777 wrote:When I insert this into a web page i.e index.php for a new default server page I don't get a result. :cry:


What do you get instead? error Messages? Nothing? Do you see your html output?

Jenathan777 wrote:Can anyone help me with this? Is there some missing code to get PHP to work?

<!DOCTYPE html> <!-- HTML 5 -->
<html>

<head>
normal head section meta and link statements
</head>

<body>
some text
<?php
echo phpinfo();
?>
</body>
</html>


Your code works correct on my XAMPP 1.7.1.

btw:
- html-head section is not the right place for plain text
- you don't need to echo your phpinfo. the function itself echoes the informations out.

Re: PHP Doesn't Work

PostPosted: 13. December 2009 03:05
by wakeup
I also have the same problem with the new version

I am using Vista sp2 32bit.

The 1.6.2 version was working correctly...

Re: PHP Doesn't Work

PostPosted: 13. December 2009 06:55
by Jenathan777
To answer your questions :-
1. The version is Xampp 1.7.2.
2. The file is .../xampp/htdocs/index.php

The fix... kind of:-

Once I stopped the Apache server, I then installed Easy_PHP.5 after deleting the Apache and PHP folders from under xampp.

Immediately PHP worked however the Apache server was still saying it was the xampp version ( via phpinfo() ).

This I don't understand since I also uninstalled the Apache server in windows control panel.

Since then I have re-installed xampp and everything still works. By this also I am puzzled.

However all is well and PHP now works fine.

Thanks all,

Jenathan777