OS X Change default Php folder


I am on macOS 10.12.6 and a Php Amateur

It comes pre-installed with Php v7.1.10 installed and the base directory where “localhost” points to is “/Users/”

How to change this to some other folder location?

Inside “/etc/apache2/httpd.conf” I have already altered “DocumentRoot” from “/Library/WebServer/Documents” to “[/path/to/new/directory]” and have restarted Apache.

This is still not reflecting same.

Note: I am not sure on this machine which I received from someone else, why the existing base directory is “/Users” and not “/Library/WebServer/Documents”

Please help


You likely have a Virtual Host that is pointing elsewhere. That is in a different file. Look for apache/extra/httpd-vhosts.conf


No luck - here is the file - https://file-nrechxudnc.now.sh/

(it has two entries and both seem to be unrelated)


Create a virtual host and point where you want it to go.


Thanks @benanamen - that helps resolve issue for this site. Is there a way I can alter the base directory as well?