Enabling apache
Mac OS X used to have a sharing function which turned apache (webserver) on so you could make websites on your machine. However, they turned that off, for whatever unknown reason.
To enable apache now, do the following.
First, let's find out your username. Open /Applications/Utilities/Terminal.app
It will come up with a terminal screen
Type:
whoami
The machine will answer with your login name. Note what it is. Let's say it's "bob" for now.
Now type:
sudo vi /etc/apache2/httpd.conf
This will start you off editing the apache webserver configuration file (https://www.youtube.com/watch?v=dFUlAQZB9Ng). Yes, this is a unix machine. The way you edit it is not by mousing, contrary to what we see in Jurassic Park(tm), but by typing in and editing text files.
To search for the necessary lines, type a forward-slash (/)
Type what you want to search for, in this case, php. Press enter after typing php as the search.
You will find a line like this:
#LoadModule php7_module libexec/apache2/libphp7.so
DocumentRoot "/Library/WebServer/Documents"
<Directory "/Library/WebServer/Documents">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options FollowSymLinks Multiviews
MultiviewsMatch Any
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist
sudo defaults write /System/Library/LaunchDaemons/org.apache.httpd Disabled -bool false
cd
chmod 711 .
chmod 755 Public