SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Apache Settings

  1. #1
    SitePoint Evangelist Caesar's Avatar
    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?

  2. #2
    SitePoint Wizard creole's Avatar
    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

  3. #3
    Dumb PHP codin' cat
    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.

  4. #4
    SitePoint Evangelist Caesar's Avatar
    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.

  5. #5
    Dumb PHP codin' cat
    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.php
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  6. #6
    SitePoint Evangelist Caesar's Avatar
    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?

  7. #7
    Dumb PHP codin' cat
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •