OS X Change default Php folder


#1

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


#2

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


#3

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

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


#4

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


#5

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