Link to home
Start Free TrialLog in
Avatar of fred2k3
fred2k3

asked on

Apache PHP Not Loading Outside of Localhost

I have an apache 2.2 webserver running on a windows machine. The php files load correctly from localhost without any issue. When trying to load the same site on a machine on the LAN it does not load. Non PHP files load without any issues.

Any ideas?

Thanks
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

How are you loading the pages (are you calling them with a URL - if so, what is it). Is your DNS setup correctly (HOSTS file on Windows)

You can open any HTML file in any browser and it will work, but that doesn't mean the server is 'serving' it. PHP has to be served by a server - you can't just open your files and expect them to work.
Avatar of fred2k3
fred2k3

ASKER

We are loading the pages using a web browser by referring to the machines local IP address. E.g. http://10.0.0.10/index.php
OK. You say it doesn't load - what do you mean? Does it time out / do you get an error etc.

Do you have a firewall in place / if so, have you opened up port 80?

If you call http://10.0.0.10/index.html you say it works fine, but not if you change the filename to index.php
Avatar of fred2k3

ASKER

Thanks Chris,

Yes, the page (on IE) times out with "This page can't be displayed".

There are no firewalls on the machine running apache.

Calling index.html works fine without any issue.
Hmmmm. All the obvious stuff seems to be checked. If you simply rename your index.html file to index.php does it still hang. (i.e it hangs on a php file even if they is no PHP in it?)

Try a simple PHP file containing something very basic:

<?php echo "PHP File"; ?>

What happens if you call http://10.0.0.10/index.php on the server itself.
Avatar of fred2k3

ASKER

Unfortunately it still doesnt work when using a basic file.

When calling http://10.0.0.10/index.php on the server itself, it redirects to http://127.0.0.01/index.php and loads?
Right - it shouldn't redirect - it should just load the page from 10.0.0.10

Maybe that's where the problem lies. If you call 10.0.0.10 on a remote computer and it tries to redirect to 127.0.0.1 then it'll never get served. Now just to figure out what's causing the redirect.

Do you have any .htaccess files in your folder? If you do, remove them.

Maybe time to have a look at your http.conf file - particularly the virtual hosts section as well, to make that's configured correctly.
Avatar of fred2k3

ASKER

Thanks, yes we do have htaccess files in your folder - they are there by default for the Magento installation. Removing them didnt resolve the issue.

I couldnt see a section about virtual hosts in the http.conf, only comments about it. We havent altered the file, so it out of the box so to speak. Any section i should look at?
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fred2k3

ASKER

Many thanks for your help.