My review: Alba MP31GD11BLK 1Gb MP3 player with SD card slot ►

◄ My review: Alba MP3256D10 MP3 player with SD card slot

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

Tags 🏷 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/ 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.

💬 Comments are off, but you can use the mail form to contact or see the about page for social media links.