Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Moving localhost (XAMPP)
Old 01-05-2009, 12:53 PM Moving localhost (XAMPP)
Ultra Talker

Posts: 316
Trades: 0
I am using Windows XP Home and have installed XAMPP so I can view PHP pages locally.

At the moment I have to put my PHP files in 'C:\xampp\htdocs' and then type 'http://localhost/index.php' to view them in the browser.

Is there anyways I can change the directory/folder where I can run/view PHP files in to 'D:\My Docs\Web'?

Thanks.
Joe3000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-05-2009, 01:32 PM Re: Moving localhost (XAMPP)
Brian07002's Avatar
Defies a Status

Posts: 2,140
Name: ...
Location: ...
Trades: 0
sure, just make a folder (what ever you want) in the htdocs folder.

ex: C:\xampp\htdocs\scripts (change scripts to whatever you want the folder to be) if you want to put the files in a folder outside the htdocs folder you need to change the httpd.conf file to:

Code:
DocumentRoot "path"
hth,
-Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 01-05-2009, 02:31 PM Re: Moving localhost (XAMPP)
Defies a Status

Posts: 1,605
Trades: 0
Just to be clear. You can have as many folders as you want within the htdocs folder. I have about 20 diffrent sites there.

To view you just browse to localhost/foldername and if there is an index file in that folder the page will load otherwise you will see the directory listing and can run a file by clicking on it.
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 01-05-2009, 05:24 PM Re: Moving localhost (XAMPP)
andrei155's Avatar
CEO of BLD Hosting

Posts: 1,514
Name: Andrei
Location: Canada
Trades: 6
The DocumentRoot directive is what you're after. Open up your apache folder, and search for httpd.conf.
__________________
No Overselling Guarantee
Now Includes a Free Domain
BLD Hosting -
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
andrei155 is offline
Reply With Quote
View Public Profile Visit andrei155's homepage!
 
Old 01-05-2009, 05:28 PM Re: Moving localhost (XAMPP)
Defies a Status

Posts: 1,605
Trades: 0
I didn't read that post too well did I?
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 01-05-2009, 06:05 PM Re: Moving localhost (XAMPP)
Ultra Talker

Posts: 316
Trades: 0
Quote:
Originally Posted by Brian07002 View Post
if you want to put the files in a folder outside the htdocs folder you need to change the httpd.conf file to:

Code:
DocumentRoot "path"
hth,
-Brian
Thanks.

I didnt want to have to move all my web stuff into the htdocs drive.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 01-05-2009, 06:08 PM Re: Moving localhost (XAMPP)
andrei155's Avatar
CEO of BLD Hosting

Posts: 1,514
Name: Andrei
Location: Canada
Trades: 6
Quote:
Originally Posted by Joe3000 View Post
Thanks.

I didnt want to have to move all my web stuff into the htdocs drive.
You could also create a shortcut to the folder, and place it on your desktop or something.
__________________
No Overselling Guarantee
Now Includes a Free Domain
BLD Hosting -
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
andrei155 is offline
Reply With Quote
View Public Profile Visit andrei155's homepage!
 
Old 01-05-2009, 06:52 PM Re: Moving localhost (XAMPP)
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
while you're in httpd.conf, make sure that index.php appears in the DirectoryIndex list then you can leave the filename off as well.


ALSO

edit your hosts file (C:\[windows_root]\system32\drivers\etc\hosts (no file extension) and add a line of;

127.0.0.1 www.mysite.local

then you can use http://www.mysite.local in your browser
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Moving localhost (XAMPP)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21626 seconds with 12 queries