Local PHP testing - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-16-2011, 09:22 AM   #1 (permalink)
Junior Member
 
johneva's Avatar
 
Join Date: Nov 2010
Location: UK
Posts: 61
Default Local PHP testing

Hi all

I have been testing php pages loacl for ages now and always just struggled with the standard setup of xampp in terms of directory issues with the live site.

So thought its time to figure out how to have multiple domains local, that are basicly copys of the real domain but with .lh instead of .com or .co.uk

So found this blog post and ran through it, but it did not seem to work.

How To Set Up Virtual Hosts In XAMPP ? Return True

After having a play around with what it had instructed for a while managed to get it to work but had to assign a different IP for each new domain and then put that domain inplace of the * where it says:

Code:
<VirtualHost *:80>
Would this be ok doing it this way instead?

According to the articles I have seen you should be able to setup your windows host file like this for example:

Code:
127.0.0.1		localhost
127.0.0.1		total-fleet-management.lh
127.0.0.1		car-maintenance-package.lh
But I had to do it like this

Code:
127.0.0.1		localhost
127.0.0.2		total-fleet-management.lh
127.0.0.3		car-maintenance-package.lh
Then they say you should be able to set your apache vitualhostfile like this:

Code:
<VirtualHost *:80>
    ServerAdmin webmaster@dummy.example.com
    DocumentRoot "C:\xampp\htdocs"
    ServerName localhost
    ServerAlias localhost

    ServerAdmin webmaster@dummy.example.com
    DocumentRoot "C:\xampp\htdocs\Fleet-Management"
    ServerName total-fleet-managemet.lh
    ServerAlias total-fleet-management.lh

    ServerAdmin webmaster@dummy.example.com
    DocumentRoot "C:\xampp\htdocs\Maintenance-Site"
    ServerName car-maintenance-package.lh
    ServerAlias car-maintenance-package.lh
</VirtualHost>
But I have had to do it like this

Code:
<VirtualHost 127.0.0.1:80>
    ServerAdmin webmaster@dummy.example.com
    DocumentRoot "C:\xampp\htdocs"
    ServerName localhost
    ServerAlias localhost
</VirtualHost>

<VirtualHost 127.0.0.2:80>
    ServerAdmin webmaster@dummy.example.com
    DocumentRoot "C:\xampp\htdocs\Fleet-Management"
    ServerName total-fleet-managemet.lh
    ServerAlias total-fleet-management.lh
</VirtualHost>

<VirtualHost 127.0.0.3:80>
    ServerAdmin webmaster@dummy.example.com
    DocumentRoot "C:\xampp\htdocs\Maintenance-Site"
    ServerName car-maintenance-package.lh
    ServerAlias car-maintenance-package.lh
</VirtualHost>

Last edited by johneva; 02-16-2011 at 10:00 AM.
johneva is offline   Reply With Quote
Sponsored Links
Old 02-22-2011, 06:14 AM   #2 (permalink)
Junior Member
 
hendricius's Avatar
 
Join Date: Feb 2011
Posts: 20
Default Re: Local PHP testing

Hi buddy thanks for sharing good tips for PHP testing tricks
hendricius is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 04:34 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting