Local Host not serving PHP pages

Alles, was PHP betrifft, kann hier besprochen werden.

Local Host not serving PHP pages

Postby bobgn1 » 04. November 2015 18:19

I’m looking for some help getting the local host function to work on my computer

Problem statement:
Configured as noted below, I cannot get a PHP document to execute phpInfo() and have it write to my monitor. I get one of the following when I execute the program from the URLs shown.

URL: http://localhost/xampp/phpinfo.php
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.14

URL: http://localhost/xampp/htdocs/phpinfo.php
Same response

URL: http://localhost:8088/xampp/phpinfo.php
This page can’t be displayed
• Make sure the web address http://localhost:8088 is correct.
• Look for the page with your search engine.
• Refresh the page in a few minutes.
Fix connection problems There is a button on the webpage at this point that asks if I want to ‘fix’ this problem. Clicking it has not effect.

Environment:
I am running an HP desktop with Win 7 on it. I have downloaded the XAMPP suite and have it running Apache, MySQL, and Mercury. My computer is running Norton 360 for its virus protection and firewall functions. The Norton firewall supplants the Windows firewall. Turning the virus protection and firewall functions off does not change the response. I have IIS set up on the computer but there is no configuration relative to use of local host, but then I don’t know if one is required.


The executing script is a simple http file as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD" xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type"
content="text/html; charset=utf-8" />
<title>PHP Info Screen</title>
</head>
<body>
<?php
phpinfo();
?>
</body>
</html>

My suspicion is that I have a Windows configuration issue (1st) or a Norton conflict (2nd) but I have not been able to find anything that fixes the issue. I’m assuming that the problem is not related to the Apache server setup but that is a risky assumption based only on the fact that I had this problem when playing with ASP files a few months ago.

Any insight into a fix for this problem would be appreciated.

Bob Goodwin
Bobgn1@cox.net
bobgn1
 
Posts: 2
Joined: 04. November 2015 05:04
Operating System: Windows 7, 64 bit

Re: Local Host not serving PHP pages

Postby Altrea » 04. November 2015 21:22

Hi,

bobgn1 wrote:My suspicion is that I have a Windows configuration issue (1st)

no

bobgn1 wrote:or a Norton conflict (2nd)

no.

As you can see in your error message, Apache is responding, so the request is fulfilled successfully. But your Apache cannot find any ressource related to that request.

Your URL is simply wrong.
http://localhost/xampp/phpinfo.php would be related to \xampp\htdocs\xampp\phpinfo.php
And now it's your turn: At which place did you save phpinfo.php?

best wishes,
Altrea
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: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Local Host not serving PHP pages

Postby bobgn1 » 04. November 2015 21:51

phpinfo.php is saved in the "c:\xampp\htdocs\" folder. Based upon your comment, I amended the URL to http://localhost/phpinfo.php and it worked. Thank you! I gather that the 'xampp/htdocs' is assumed.
bobgn1
 
Posts: 2
Joined: 04. November 2015 05:04
Operating System: Windows 7, 64 bit


Return to PHP

Who is online

Users browsing this forum: No registered users and 50 guests