Page 1 of 1

localhost not displaying correctly on windows, works on mac

PostPosted: 11. February 2014 18:30
by breed23
My test site works correctly on my mac, but doesn't display properly on windows 7 (1.8.3) or windows xp (1.8.2), it actually looks the exact same on both. I have the html files in my htdocs folder. The only thing I have to go on is it seems like the virtual includes (which i barely understand, this is my first experience with them).... <!--#include virtual="insertfile_submenu4.html" --> for example, don't seem to be showing up in windows.

To compound matters, in windows I got the error message that the page index.php could not be found. But the index.html page was displaying partly. I had no idea what needed to be done so i copied the index.html and turned it into index.php. I no longer get that error message but the page still displays only partly. Anyway, and ideas would be appreciated.

Re: localhost not displaying correctly on windows, works on

PostPosted: 11. February 2014 21:08
by Nobbie
breed23 wrote:The only thing I have to go on is it seems like the virtual includes (which i barely understand, this is my first experience with them).... <!--#include virtual="insertfile_submenu4.html" --> for example, don't seem to be showing up in windows.


To enable this kind of "include" (or "virtual include"), you have to enable SSI (Server Side Includes) in Xampp. Usually pages, that contains SSI-Statements (these always start with "<!--#..." ) should have extension *.shtml (instead of *.html). This may be the first issue on your site, because it is a bad idea to handle *.html like *.shtml. Anyway, if you need SSI, you have to enable SSI for the desired extension (google for SSI and Apache, you will find appropriate infos).

On Unix-like Systems (and Mac OSX is a Unix-like System, as well as Linux), there is a so called "Bit-Hack" to enable SSI (this depends on specials rights in the filesystem). That might be the reason that it runs on OSX "out of the box", whereas Windows has a complete different rights system and there is no "Bit-Hack", therefore you MUST use the file extension for configuring SSI. Anyway, SSI is an old and clodgy script interface and it is really outdated, there are by far better solutions like PHP for example.

breed23 wrote:To compound matters, in windows I got the error message that the page index.php could not be found.


This is a different problem and due to lack of better description if have no idea what is going wrong. We need a far better description of what you are doing (what do you enter in the browsers URL box?) and what is the fully qualified error message?

If you change index.php into index.html, that does not solve your problem, because index.html is not parsed by the PHP interpreter and so you wont get any results as if you (successfully) run index.php. So this is a bad idea anyway and you should undo this.