PHP not interpreted (Win7) 1.7.7 [SOLVED]

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

PHP not interpreted (Win7) 1.7.7 [SOLVED]

Postby Ivo21 » 07. December 2011 11:14

I am new to XAMPP and web programming.
I installed XAMPP 1.7.7 on Windows 7.
On the status page, MySQL, PHP, HTTPS (SSL), CGI and SSI are all activated.
I tried my first PHP script, the easiest, by writing this code

<html>
<head>
<title>My First PHP Page</title>
</head>
</body>
<?php print('Hello world'); ?>
</body>
</html>

I opened the script file in Firefox 8.01 but PHP is not interpreted. I get a blank page (though, with the right header "My First PHP Page").
Any suggestion?
Thanks for any help, Ivo
Ivo21
 
Posts: 3
Joined: 07. December 2011 11:07
Operating System: Windows 7

Re: PHP not interpreted

Postby Sharley » 07. December 2011 11:16

What did you name the file and where did you put the file in XAMPP?

What did you type in the browser?
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 interpreted

Postby Ivo21 » 07. December 2011 11:28

My file is called first.php and is located on c:\server (on c:\server\xampp I installed XAMPP).
In Firefox I open it through "File - Open File" then selecting it. The URL shown is file:///C:/server/first.php
Ivo21
 
Posts: 3
Joined: 07. December 2011 11:07
Operating System: Windows 7

Re: PHP not interpreted

Postby Sharley » 07. December 2011 11:46

Your files go in the C:\server\xampp\htdocs folder (DocumentRoot or the web root it is often called).

The file name first.php is correct.

The first.php file needs to be parsed by the Apache server, so make sure Apache and MySQL are both running and then type this in your browser:
http://localhost/first.php
You should then see your file's php content.

To test your XAMPP installation type:
http://localhost


New users can find self help by reading these first:
readme_en.txt file in the xampp folder.
http://www.apachefriends.org/en/xampp-windows.html
http://www.apachefriends.org/en/faq-xampp-windows.html

Some useful reading that may help you help us to find suitable solutions:
viewtopic.php?f=16&t=48331
viewtopic.php?f=16&t=32670
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 interpreted

Postby Ivo21 » 07. December 2011 12:04

It works. I tried even before to put the first.php file in the htdocs folder but I did access it by opening a file in Firefox instead of localhost so it did not work. Thanks a lot.
Ivo21
 
Posts: 3
Joined: 07. December 2011 11:07
Operating System: Windows 7

Re: PHP not interpreted

Postby Sharley » 07. December 2011 12:05

You're welcome and thanks for the feedback. 8)

Best wishes. :)
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 22 guests