Macos Catalina Apache

  

  1. Macos Catalina Apache Free
  2. Macos Catalina Apache Config
  3. Macos Catalina Apache Document Root

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. $ httpd -v Server version: Apache/2.4.41 (Unix) Server built: Aug 29 2019.

In this post we see how to change the PHP version of Apache in MacOS Catalina.

Scanpotter for mac os catalina 2017. The thing is macOS runs atop UNIX. So most UNIX software installs easily on macOS. Furthermore, Apache and PHP come preinstalled with macOS. To create a local web server, all you need to do is configure Apache and install MySQL. The new macOS Mojave 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. $ httpd -v macOS Mojave comes with Apache/2.4.34.

MacOS Catalina comes with Apache and PHP 7.3 already preinstalled.
Sometimes we may need to run a different version of PHP with Apache.
For example Magento 2 needs PHP 7.2 to run .

Install PHP 7.2 using Homebrew

To checkout the current PHP version, run:

In my case, it was PHP 7.3.

So, first we need to install the PHP version we need. I used Homebrew to install PHP 7.2.

Next, I enabled PHP 7.2 as my default PHP version for the cli. (zsh):

Or, if you use bash, use the following:

(If you watch the terminal output during PHP 7.2 installation, you’ll see that Homebrew gives us these commands.)

Now, run the following command again and you should see that PHP 7.2 is enabled.

Macos catalina apache

Change Apache PHP version to PHP 7.2

If you run phpinfo() in a browser, you see that although we changed the PHP version of the cli to PHP 7.2, Apache still uses PHP 7.3.

Let’s change that.
In the terminal, run the following command to edit Apache configuration file:

To disable PHP 7.3, find the following line and comment it out by entering # at the beginning:

To enable PHP 7.2, paste the following line, bellow the previous.

Macos Catalina Apache Free

Restart Apache:

Refresh the browser and you should see that Apache is now using PHP 7.2

That’s it!

Macos Catalina Apache Config

Macos catalina apache download

If you have any questions or want to say hi, please leave a comment below.

——

Macos Catalina Apache Document Root

I would also like to reference the following: