PHP Doesn't Work

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

PHP Doesn't Work

Postby Jenathan777 » 09. December 2009 06:48

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>
Jenathan777
 
Posts: 4
Joined: 09. December 2009 06:35

Re: PHP Doesn't Work

Postby Stepke-DSL » 09. December 2009 07:42

Where did you save the file and how do you navigate to the file in your browser?
Stepke-DSL
 
Posts: 313
Joined: 12. July 2007 16:08
Operating System: Win XP Pro SP3 + SuSe Linux

Re: PHP Doesn't Work

Postby Bill Smith » 09. December 2009 07:44

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.
Bill Smith
 
Posts: 7
Joined: 09. December 2009 07:14

Re: PHP Doesn't Work

Postby Altrea » 09. December 2009 07:51

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.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8298
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: PHP Doesn't Work

Postby wakeup » 13. December 2009 03:05

I also have the same problem with the new version

I am using Vista sp2 32bit.

The 1.6.2 version was working correctly...
wakeup
 
Posts: 3
Joined: 13. June 2008 19:14

Re: PHP Doesn't Work

Postby Jenathan777 » 13. December 2009 06:55

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
Jenathan777
 
Posts: 4
Joined: 09. December 2009 06:35


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 75 guests