- Install Apache Mysql Php On Macos Catalina 10.15
- Install Apache On Mac Catalina Os
- Install Apache On Mac Catalina Free
The title of this page is quite 'misleading' as both Apache and PHP comes pre-bundled in macOS Catalina 10.15. We merely need to configure them.
Press ⌘ + SPACE (Spotlight Search) and bring up the terminal. Start as root

1) The Apache HTTP Server
Installing Apache Tomcat 6 on Mac OS X is primarily a matter of downloading the appropriate packages and then following the UNIX installation instructions included with the package. However, OS X does have some peculiarities that make installation somewhat different than on your average UNIX box. This tutorial will go through the process of getting Apache, MySQL, PHP (or otherwise known as the 'AMP' stack) and phpMyAdmin running on the new mac OS Big Sur. This guide will also work on macOS Catalina and Mojave. This tutorial sets up the AMP stack in more of a traditional way using the loaded Apache and PHP and downloading MySQL. Install Apache, MySQL, PHP on macOS 11 Big Sur and Reset Forgotten Admin Password on macOS Big Sur and Installing node.js on macOS Big Sur and earlier Enable the root user in macOS Big Sur and earlier Where is the bash shell in macos Big Sur and Catalina? How to Add to the Shell Path in macOS Big Sur.
As Apache 2.4 comes pre-packaged in macOS Catalina 10.15, check the version to verify
To install Tomcat 9 you will need Java Standard Edition (SE) 8 or higher to be installed. Achieve this by installing OpenJDK, an open-source implementation of Java SE and Java Development Kit (JDK). First, you will need to update our apt package: $ sudo apt update. Then next: $ sudo apt install default-jdk. In this tutorial, I'll be using my Mac running macOS 10.14 ('Mojave'), but the steps are the same for the other versions of Mac OSX and macOS 10.x (update: I've tested this on Catalina and it works there too). Go to Apache Friends and download the correct version of XAMPP. For this tutorial, I'll be using XAMPP 7.3.2 for OSX.
If the version number is proper, start the server by running the command
Next, type http://localhost in the URL bar of the web browser. It should display the It works! page.
2) The It works! Page Location
The default It works! page is located inside /Library/WebServer/Documents as the index.html.en file.
3) Changing the Work Directory
Get back to the login directory typing
Navigate to your home directory (it is named with your user name). In my case, it is dennisgabil
There, create a directory for your web projects, say Sites
For easy access later, you can place this newly created Sites directory in the Favorites section of your Mac's Finder. Do Spotlight Search (⌘ + SPACE) on your username and drag and drop Sites to the Finder sidebar.
4) Modifying httpd.conf
Next, navigate to /etc/apache2
Create a backup of the httpd.conf file
We need to make some changes to the httpd.conf file. Open it with vi editor
Find the line
#LoadModule php7_module libexec/apache2/libphp7.so
and uncomment it, i.e., remove # (focus the cursor on # and press x).
Then find the two lines below
DocumentRoot '/Library/WebServer/Documents'<Directory '/Library/WebServer/Documents'>
and change them to
DocumentRoot '/Users/dennisgabil/Sites'<Directory '/Users/dennisgabil/Sites'>
Install Apache Mysql Php On Macos Catalina 10.15
(You change /dennisgabil/ in the two paths to your /username/ ). For inserting text in vi, press i. Save the changes (press ESC, then : (SHIFT + :), then wq!)
5) Restart Apache
Restart the server by running the command
Now all your web projects can go inside /Users/dennisgabil/Sites. If you have a web project called, say, myproj, inside that directory, you can access it by typing localhost/myproj in the URL bar of your browser and it will display your default index.html (or index.php, keeping in mind that we are learning PHP) file. If you have a Git repository for your project, you can clone it there and work.
Install Apache On Mac Catalina Os
Just for the purpose of testing, create an index.php page that displays Hello, World! inside the /Sites directory (do not forget to change /dennisgabil to your /username in the path)
Install Apache On Mac Catalina Free
Access http://localhost. The page should display Hello, World!