- MAMP is good, but it's gonna install everything from scratch. The same goes for PHP via homebrew. I have tried all of those. But you have to remember that your Mac comes bundled with Apache and PHP out of the box. You just have to add MySQL to the mix and get rolling.
- You can verify PHP is enabled by creating a phpinfo page in your DocumentRoot. The default DocumentRoot for macOS Catalina is /Library/WebServer/Documents. In order to verify this, we run the command below to find out our Apache configuration. Grep DocumentRoot httpd.conf.
- Getting Started. First, open the Terminal app and switch to the root user to avoid permission issues.
- Download Apache Php Mysql For Mac
- Apache Mysql Php Macos
- Apache Mysql Php For Mac
- Linux Apache Mysql Php
Note: This post assumes you followed installing Apache, PHP, and MySQL on Mac OS X Mojave and have since upgraded to macOS Catalina. If you did not follow the original post, you should follow installing Apache, PHP, and MySQL on macOS Catalina.
When Mac OS X upgrades it overwrites previous configuration files. However, before doing so it will make backups. For Catalina the original versions may have a suffix of
mojave
or be copied to a backup folder on the Desktop. Most of the time, configuring your system after updating Mac OS X is simply a matter of comparing the new and old configurations.This post will look at the differences in Apache, PHP, and MySQL between Mac OS X Mojave and macOS Catalina.
MySQL Download the MySQL package for Mac OS X.5 (32 or 64 bits depending on your machine) Install everything in the package in this order: mysql, the startup item, the. The MAMP package includes the Apache web server, PHP engine, and MySQL database. Mac OS X 10.5 and later include the MySQL database and Apache server with PHP support. While it certainly is possible to configure the built-in database and server with the IDE, MAMP’s all-in-one bundle provides a convenient and easily configurable solution.
Updating Apache
Mac OS X Mojave and macOS Catalina both come with Apache pre-installed. As noted above, your Apache configuration file is overwritten me when you upgrade to macOS Catalina.
There were a few differences in the configuration files. However, since both Mojave and Catalina run Apache 2.4, you could simply backup the configuration file from Catalina and overwrite it with your Mojave version.
However, I encourage you to stay up-to-date. As such, you should take the time to update Catalina's Apache configuration. First, create a backup and compare the two configuration files for differences.
Now edit the Apache configuration. Feel free to use a different editor if you are not familiar with vi.
Uncomment the following line (remove
#
):In addition, uncomment or add any lines you noticed from the
diff
above that may be needed. For example, I uncommented the following lines:Finally, I cleaned up some of the backups that were created during the macOS Catalina upgrade. This will help avoid confusion in the future.
Note: These files were not changed between versions. However, if you changed them, you should compare the files before running the commands.
Restart Apache:
Updating PHP
Mac OS X Mojave came with PHP version 7.1 pre-installed. This PHP version has reached its end of life. macOS Catalina comes with PHP 7.3 pre-installed. If you added any extensions to PHP you will need to recompile them.
Also, if you changed the core PHP INI file it will have been overwritten when upgrading to macOS Catalina. You can compare the two files by running the following command:
Note: Your original file may note be named something else. You can see which PHP core files exist by running
ls /etc/php.ini*
.The Missionary is a side quest located in the. Dragon age origins korcari wilds map. Leaves and ventures to the Korcari Wilds to find blood vials for the ritual. Soon after entering the group is attacked by, near this, a dead body laying in water can be found.
I would encourage you not to change the PHP INI file directly. Instead, you should overwrite PHP configurations in a custom PHP INI file. This will prevent Mac OS X upgrades from overwriting your PHP configuration in the future. To determine the right path to add your custom PHP INI, run the following command:
Note: It appears Catalina does not include the PHP Zip extension. This is a popular extension used by many packages. Once I determine a work around, I will post an update.
Updating MySQL
MySQL is not pre-installed with Mac OS X. It is something you downloaded when following the original post. As such, the macOS Catalina upgrade should not have changed your MySQL configuration.
Find this interesting? Let's continue the conversation on Twitter.
In this tutorial we will learn to install Apache, MySQL, PHP on macOS Catalina 10.15.
About macOS Catalina
Apple released macOS Catalina 10.15 on 7th October 2019 and it includes Apache and PHP. So, all we have to do is enable them. Then install MySQL and we are ready for development. So, lets get started.
Note! Support for 32 bit apps is removed in Catalina so, all your 32 bit applications will no longer work. Kindly upgrade your applications.
Apple has also made zsh as the default shell. You can learn more about it here.
To change the default shell check the tutorial How to change default shell to bash on macOS Catalina.
We will be using the pre-installed Apache and PHP and we will download and setup MySQL database.
If you are using macOS Mojave then check out this tutorial How to install Apache, MySQL, PHP on macOS Mojave 10.14
Lets go ahead and configure our LAMP stack development environment on macOS Catalina.
Apache
The new macOS Catalina comes with Apache pre-installed. All we have to do is switch it on.
Open Terminal using macOS Spotlight or go to /Applications/Utilities and open Terminal.
To check the version of Apache installed run the following command in the Terminal.
Note! macOS Catalina comes with Apache 2.4.41
To start Apache web server run the following command.
This command will start Apache server.
![Apache mysql php mac high sierra Apache mysql php mac high sierra](/uploads/1/3/4/1/134126113/369044242.png)
When you use
sudo
in the terminal then you will be prompted to enter your admin password to proceed.If you want to stop the Apache server then run the following command.
And to restart Apache server run the following command.
After starting Apache server go ahead and test it by opening a browser like Safari or Chrome and visit
http://localhost
.You will get to see the following output in your browser.
By default, the file is getting served from
/Library/WebServer/Documents
directory. We will change this is the following sections.Special ThanksThis prank would not have been possible without the help of the following people: shgeldz, AmethystBlack, GavMakesGames, Starrcasm, TheSuzerain, SChandelure, spsounds, Deouen, JV.And to everyone who fell for it, or played along we hope you had a good time. Pokemon phoenix rising link. Some were bitter over being tricked, but most of them were good sports about it – after all, that’s what April Fools Day is all about!And then, it was over as quickly as it began. And we all agreed never to speak of it again.Except for this retrospective, I guess. By 10AM the following morning, the site at pokemonrisingrainbow.com was taken down and the twitter scrubbed of all tweets, except one redirecting to.
In case you don't get to see the above output then run the following command to check the error.
Document Root
This is the location in the computer file system from where the files are accessed when we visit the http://localhost in a browser.
Document Root is a directory where we put our website files.
On Mac we have two document root. One is at the system level and the other is at the user level.
System level document root
The system level document root in macOS Catalina is located in the following directory.
User level document root
For the user level we can create a directory called
Sites
in user directory. So, open Terminal and get ready to create the user level document root directory.Creating Sites
directory
Run the following command in the Terminal to switch to the user home directory.
Now, run the following command to create the
Sites
directory.You can merge the above two commands into one by running the following command.
For me the user document root path is the following.
You will get a similar path for your Mac.
Creating username.conf
file
Now, we will create a
username.conf
file to configure our document root.Download Apache Php Mysql For Mac
Note! Replace the username with your username.
For example, my username is yusufshakeel so, my file is
yusufshakeel.conf
.Type the
whoami
command in the terminal and it will tell you your username.Open terminal and go to the following directory.
Now create the configuration file username.conf inside the users directory.
In the following example I am using vi editor. You can use other editors like vim or nano.
Press the i key to enter into INSERT mode and then type the following in the file.
Don't forget to replace
YOUR_USER_NAME
with your username.Here is what I have written in my
yusufshakeel.conf
file.Now, come out of the INSERT mode by pressing the Esc key. Now save the file and exit by typing the following :wq and then hit Enter.
The permission of this file should be the following.
You can change the permission by typing the following command.
Where, username is your username that you have set.
Configuring the httpd.conf
file
Now we switch to apache2 directory by typing the following command in the Terminal.
Inside this directory we have the
httpd.conf
file.![Apache mysql php for mac Apache mysql php for mac](/uploads/1/3/4/1/134126113/292016293.png)
As a good practice we will make a backup copy of the
httpd.conf
file by typing the following command.Now open the httpd.conf file using
vi
and uncomment the following lines.To uncomment the lines remove the
#
from the start of the line.Uncomment the following line for User home directories.
Now change the DocumentRoot.
Find the following lines and comment them by adding
#
at the beginning of the line.And add the following two lines below the commented lines.
Don't forget to replace
YOUR_USERNAME
with your username.And set the
AllowOverride None
to AllowOverride All
.Your DocumentRoot should now look something like the following.
Now, come out of the INSERT mode by pressing the Esc key. And save and exit the file by typing :wq key and then Enter.
Configuring the httpd-userdir.conf
file
Now, time to make some changes in the httpd-userdir.conf file.
In the terminal type the following command to go to the extra directory.
As a good practice create a backup copy of the
httpd-userdir.conf
file.Now open the file using
vi
.Enter into INSERT mode and uncomment the following line.
Now, come out of the INSERT mode and save the changes.
Now, check if everything is configured properly by typing the given command.
Now restart Apache using the following command.
PHP
macOS Catalina comes with PHP 7.3.8 pre-installed.
To check the version of PHP in the Terminal type the following command.
Now we go to the apache2 directory.
Next, we open the
httpd.conf
file.Now, enter into INSERT mode and uncomment the following line to run PHP 7 by removing the
#
sign from the start of the line.Now, save the changes and exit the file by typing :wq keys and hit Enter.
You can now restart Apache by running the following command.
Printing phpinfo
Create
index.php
file inside the Sites directory.Now open the file in your favourite text editor or PHP IDE and write the following code.
Now, visit
http://localhost
and you will get to see a similar output.Download MySQL community server
Head over to mysql.com website and download the latest version of the MySQL Community Server.
Download and run the installer and follow the steps to install MySQL database on your Mac.
Set the root password when prompted and note it down.
To run MySQL server open System Preferences and go to MySQL.
Click on the Start MySQL Server button to start the server.
You will be asked to enter your admin password. Enter the password and the MySQL server will start running.
Apache Mysql Php Macos
Extra
Apache Mysql Php For Mac
To access your MySQL database tables you can either use phpMyAdmin, MySQL Workbench or Sequel Pro.
Linux Apache Mysql Php
Alright, this brings us to the end of this tutorial. Hope this helped. Please share if you find this website useful. Have fun developing. See you in the next tutorial.