This tutorial shows how to install Nginx + PHP + MySQL on Mac OS Catalina.
It’s very straightforward process and doesn’t takes you more than 10 to 15 minutes.
Install PHP
First of all, ensure that brew brew is up-to-date and then install latest php 7.4 version.
1 2 |
brew update brew install php@7.4 |
To locate your ini files type the following command:
1 |
php --ini |
You should get output like that:
1 2 3 4 |
Configuration File (php.ini) Path: /usr/local/etc/php/7.4 Loaded Configuration File: /usr/local/etc/php/7.4/php.ini Scan for additional .ini files in: /usr/local/etc/php/7.4/conf.d Additional .ini files parsed: /usr/local/etc/php/7.4/conf.d/ext-opcache.ini |
Install Xdebug
Very important step for any developer is to install debuger module.
From brew version, modules for php are installing with pecl only.
Type following command to install xdebug:
1 |
pecl install xdebug |
Then create and configure an additional .ini file for xdebug:
1 2 3 4 5 6 7 |
touch /usr/local/etc/php/7.4/conf.d/ext-xdebug.ini # Add the following lines to ext-xdebug.ini file nano /usr/local/etc/php/7.4/conf.d/ext-xdebug.ini [xdebug] zend_extension = "/usr/local/Cellar/php/7.4.5_2/pecl/20190902/xdebug.so" |
Reload php-fpm:
1 2 3 |
brew services restart php brew services list |
Verify you have completed successfully previous steps:
1 |
php -v |
You should see the following:
Install Nginx
TBD
Install MySQL
TBD