Forum Moderators: coopster

Message Too Old, No Replies

Php not working in virtual host.

Horizontal menu bar not working

         

Bucephalus

4:03 am on Feb 26, 2010 (gmt 0)

10+ Year Member



Hi

I have xampp on my windows box. I have created a virtual host as described in <snip>
Now, when I run my website in the tradition htdocs folder the horizontal menu works. But when I try and run the website in the virtual host the horizontal menu doesnt' appear.

The code for the horizontal menu is:

<!--sphider_noindex--><?php require_once('includes/horizmenu.inc.php'); ?><!--/sphider_noindex-->


I made this query on the apache forum and i was asked if this code is still there when I go to teh webbrowser and view source. It is still there. Not only that, but when I serve off the htdocs, the php code isn't there, i.e. it did what it was supposed to do.

So somehow I think my configuration isn't complete for the virtual host.

Does anyone have any idea what is going on?

David.

[edited by: eelixduppy at 1:32 pm (utc) on Feb 26, 2010]
[edit reason] removed URL [/edit]

penders

11:40 am on Feb 26, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Presumably you are accessing your site via the URL as specified in your HOSTS file? (And not directly using the directory path on your machine?)
eg. in HOSTS file:
127.0.0.1 local.example.com

And then access this via the URL:
http:/ /local.example.com
(NB: no spaces!)

Also, browsers tend to cache values in the HOSTS file. So you need to clear your browser cache and possibly restart it. Although, I have noticed that Chrome will pick up changes in the HOSTS file almost immediately, without having to clear the cache or restart.

Although TBH, if you are able to access your site via the URL then your virtual host would seem to be working?

I made this query on the apache forum and i was asked if this code is still there when I go to teh webbrowser and view source. It is still there.


The code that's still there is the require_once() statement above? This does sound as if you are accessing the site (or at least the HTML files within the site) from outside of the virtual host, ie. not using the URL, but your machines directory path instead?