SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: Apache Settings
-
Mar 27, 2001, 09:19 #1
- Join Date
- May 2000
- Location
- On some harddisk
- Posts
- 599
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I've just installed Apache and PHP4 on my system. I understand that .php files have to be placed in the .....\htdocs\*.* folder for it to be parsed when I call it up on my browser using http://localhost/filename.php
I was wondering if I could edit my httpd.conf file so that I could simply parse any .php file on my computer without having to place files in my htdocs folder. (I.e c:\abc\test.php) ...
I hope you guys understand what I'm trying to say. Can anyone help?
-
Mar 27, 2001, 09:39 #2
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I don't think you would want to do that as it would probably involve setting your webroot as your "C" drive. That would probably work, but it could cause complications with your OS...might not be a good idea to do that one.
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
Mar 27, 2001, 10:51 #3
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
AS A side note to what Andy said, you do not have to make the htdocs folde rinside your apache root the web root, you can choose any folder on your hard drive, simply change the DocumentRoot directive in the httpd.conf folder and restart the server.
Please don't PM me with questions.
Use the forums, that is what they are here for.
-
Mar 27, 2001, 17:19 #4
- Join Date
- May 2000
- Location
- On some harddisk
- Posts
- 599
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
freddydoesphp,
What must I do so that I can choose any folder on my hard drive as the web root? (I.e What changes must I do to my DocumentRoot directive?)
How do I call up the .php file on my computer then if I enable parsing of any .php file within any folder?
Originally posted by freddydoesphp
AS A side note to what Andy said, you do not have to make the htdocs folde rinside your apache root the web root, you can choose any folder on your hard drive, simply change the DocumentRoot directive in the httpd.conf folder and restart the server.
-
Mar 27, 2001, 18:49 #5
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Well if you made your Document Root look like
DocumentRoot C:\wwwroot
You would nee dto create a folder named wwwroot on the c drive then put your php files in it. Then access them as http://localhost/phpscriptname.phpPlease don't PM me with questions.
Use the forums, that is what they are here for.
-
Mar 28, 2001, 04:52 #6
- Join Date
- May 2000
- Location
- On some harddisk
- Posts
- 599
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I don't think you guys are understanding what I'm trying to say here.
What I want to do is to enable parsing of any file on my computer so that I could simply put them in any folder on my hdd and call them up on the browser with the normal ms dos path such as c:\apple\abc.php or d:\cd\palm.php
Is there ANY way at all?
-
Mar 28, 2001, 10:51 #7
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
First off you must understand that in order to get your pages parsed by php through a browser you must use a web server. You chose Apache, Apache has a setting called DocumentRoot where all pages should go to be accessible by the server. Why do you want to have it so all folders can parse php? That is saying let the world access evry file on my hard drive because I set my DocumentRoot to c:\. The reason for the Documentroot is security so you can have your web pages eparate from the rest of your system. So the answer to your original question is no. What is stopping you from putting them in the place where your DocumentRoot directive is set to?
The other option that comes to mind is to use Apache Aliases to make an alias point to another folder somewhere.
Let's pretend you have your DocumentRoot set to C:\wwwroot
And in My Documents you have a folder named timesheet for example, within this folder lives a php app that you want to run from the browser but don't weant to move the folder. You could put this in your httpd.conf
Code:Alias /timesheet/ "C:/Documents and Settings/louis.UFI-OFFICE/My Documents/timesheet/" <Directory "C:/Documents and Settings/louis.UFI-OFFICE/My Documents/timesheet"> DirectoryIndex index.html index.htm index.php Options Indexes MultiViews Order allow,deny Allow from all </Directory>
This says any request that look like http://localhost/timesheet/
Should point to the folder in My Documents. Does this clear it up?Please don't PM me with questions.
Use the forums, that is what they are here for.
Bookmarks