Forum Moderators: coopster

Message Too Old, No Replies

XAMpp

does .php files work in any directory?

         

mtzheng

2:34 am on Jun 24, 2005 (gmt 0)

10+ Year Member



i just installed xampp.
my test file is hello.php.
both of following work out perfectly.

[localhost...]
[127.0.0.1...]

which one of following do i use?
My local website files are outside of xampp directory


<form action="mail.php" method="post" id="contact">


<form action="http://localhost/mail.php" method="post" id="contact">

my question is can i place mail.php in any directory on my computer?

yes, but how?
no, y not?

Thank you.

Timotheos

5:39 pm on Jun 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



my question is can i place mail.php in any directory on my computer?

There's a setting in the file httpd.conf that sets the directory to serve web pages. By default in a XAMPP Windows set up it is "c:/apachefriends/xampp/htdocs". Just find the line that has the DocumentRoot setting. So all your web pages must go in that directory.

Now you can easily change that to any directory you want and restart Apache and you should be good to go.

Tim

mtzheng

11:43 pm on Jun 24, 2005 (gmt 0)

10+ Year Member



thanx tim.

ergophobe

4:38 pm on Jun 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This is a tiny bit tricky, but what I do is leave the xampp files and docs where they are and let the server get at them via localhost. Then for each site I work on, I create a directory wherever I want to and make it a virtual host. Sicne you have xampp, I assume you're on WinXP. In which case

find the "hosts" file, usually in something like C:\WINNT\system32\drivers\etc and add an IP for each vbirtual host you want

127.0.0.2 mysite1.loc
127.0.0.3 mysite2.loc
127.0.0.4 testing

Then in your httpd.conf, at the very end in the virtual hosts section, add

<VirtualHost 127.0.0.2>
DocumentRoot C:/websites/mysite1/www
ServerName mysite1.loc
</VirtualHost>

The ".loc" TLD is arbitrary - you can leave it off, use .com or wahtever. I do it that way so it's clear to me from the URL when I'm looking at the local version and when I'm not.

The advantage is that you now go to [mysite1.loc...] to get to that site's home page.

Timotheos

3:59 am on Jun 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Tom that's very cool!

ergophobe

3:56 pm on Jun 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Tim, Once you get used to it, you will never want to develop and test any other way.

Timotheos

3:42 pm on Jun 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Once you get used to it, you will never want to develop and test any other way.

I got used to it the minute I read your post ;-)

KiShOrE

8:18 pm on Jul 29, 2005 (gmt 0)

10+ Year Member



Can anyone tell me how to run phpMYAdmin in XAMPP?

I'm using the Windows version.

Thanks.

coopster

1:28 am on Aug 3, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I'm not a PHPMyAdmin user, but I'm guessing it is no different than any other installation, KiShOrE. Are you having problems?