My review: Alba MP31GD11BLK 1Gb MP3 [...] >>

<< My review: Alba MP3256D10 MP3 player [...]

2008-11-05: Working on multiple sites with an easyPHP offline server

1 comment

Categories: All Tech

EasyPHP is a straightforward way to get yourself a local server with PHP and MySQL. However, by default you browse this local server using http://localhost/, and putting each site into a different directory within this can cause a few headaches.

It's often more convenient to reference files relative to root — /directory/file.ext — than work out where they are relative to the current page — ../../directory/file.ext or similar — especially when using PHP include statements to do your on-every-page navigation stuff. This doesn't mesh particularly well with a single offline instance of Apache (such as that supplied with easyPHP) that contains directories for multiple sites, because root is /localhost/ rather than /localhost/examplesite.com/ or whatever.

Fortunately this can be solved, though since the search terms are rather generic finding the information can be tricky. In fact, you only need to edit a couple of files (then restart your offline server for the changes to take effect.)

in httpd.conf, add:

in your hosts file (probably C:\windows\system32\drivers\etc\hosts or similar):

They're then available in your browser as http://examplesite1/ etc.


Older entry >>

<< Newer entry

ADD COMMENT

noobie
06-Feb-2013
Out of the dozen or so explanations I have read concerning this matter yours' is by far the most succinct. When direction is given in this manner it usually denotes' a complete understanding of the subject-matter.

Thanks,
DER

Older entry >>

<< Newer entry

ADD COMMENT





[verification image]
Please type the security text as shown to the left