

#Php for mac os install
Pecl install xdebug brew link -overwrite -force įor each version, you have installed update the php.ini. To install xdebug for each version of php (cli and fpm) run the following. I like xdebug for development with PHPStorm. Keep in mind you may need to reconfigure that version of PHP but I’ve found your php.ini files remain the same. When this happens you can reinstall the PHP version having the error. # brewĪs time passes Homebrew is bound to break your PHP installations. If you want to change the default php CLI you can set it using brew or if added, the bash function phpv 7.4. How do I switch between PHP versions? You can add the following to your bash scripts, to make switching between multiple PHP versions on macOS simple: # Make switching versions easy php72 -v Switching Between Multiple PHP Versions For example, you can check the exact version of the aliased version of PHP. Once you reload your bash file, you can access each alias from the Mac command line. For example, I use port 9074.Īlso, you will want php-fpm to run with your user account and not _# Apple Silicon M1 ChipsetĪlias php72="/opt/homebrew/opt/ /bin/php"Īlias php73=" /opt/homebrew/opt/ /bin/php"Īlias php74="/opt/homebrew/opt/ /bin/php"Īlias php80=" /opt/homebrew/opt/ /bin/php"Īlias php81=" /opt/homebrew/opt/ /bin/php" Change the ports of each php-fpm to match its php version number. Now, for each version update the php-fpm you will need a unique port. brew unlink phpīrew link -overwrite -force Next, set PHP 7.4 as your default php CLI version. brew tap shivammathur/phpīrew install shivammathur/php/ First, don’t use the default homebrew core tap for PHP. Now, install multiple PHP versions on your Mac computer. postgres-# \du Install Multiple PHP Verions Install postgresql (not the postgres app). mysql> SHOW VARIABLES LIKE 'validate_password%' mysql> SET GLOBAL validate_password.policy=LOW Postgres
#Php for mac os password
You might have to reset your password security level to LOW if the above fails for ERROR 1819 (HY000): Your password does not satisfy the current policy requirements. Mysql> ALTER USER IDENTIFIED WITH mysql_native_password BY 'password' Note, there is no space before the username and password. Next, MySQL 8 authentication needs to be updated per user to mysql_native_password. Now, secure using the password password and then restart. Sql_mode = "ONLY_FULL_GROUP_BY,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION" brew install opensslĬode /opt/homebrew/etc/my.cnf # Default Homebrew MySQL server config You will need these before moving forward. Now, that the tools are installed, you can get into the rest of the setup process. Homebrew will ask you to run a few commands, don’t miss them.
#Php for mac os code
xcode-select -installĪlso, you will need VS Code installed with the code command in your system path.įinally, install Homebrew. You will be using the terminal a lot coming up (I like iTerm2). Next, install the CLI tools from the terminal.
#Php for mac os software
Here is the software you will install, in order: In the end, you will have a robust, clean, and fast local web development environment on Mac’s Intel or Apple Silicon (M1, M1 Pro, and M1 Max) chipsets.

In this tutorial, you will set up nginx and multiple PHP versions on macOS 13 Ventura.
