How to set the DOCUMENT_ROOT and site root in my local PHP dev setup?

前端 未结 5 1642
孤街浪徒
孤街浪徒 2021-01-30 11:56

I\'m doing a job for a guy with a site online. It\'s an alien site to me, and I\'m slowly working through the strange code. I have MAMP locally and my http://localhost/ has many

5条回答
  •  被撕碎了的回忆
    2021-01-30 12:42

    It's a server-specific setting. If you're running Apache, all you'll need to do is edit your httpd.conf file (on a Unix-based system, it should be either in /etc/apache2/httpd.conf or /etc/httpd/httpd.conf, depending on which version of Apache you have). There should be a line in the file that looks like this:

    #
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    #
    DocumentRoot "/whatever/your/document/root/is"
    

    Technically, Eli's way works as well, but I don't think editing server variables is really a good idea, in general.

提交回复
热议问题