PHP 101 macOS

php

To install Apache with multiple versions of PHP on macOS 14.0 Sonoma follows steps here: https://getgrav.org/blog/macos-sonoma-apache-multiple-php-versions

After installation you can switch PHP version using following command:

sphp 8.3

Changing memory limit for PHP

You can change memory_limit in php.ini. You can find the php.ini at: /opt/homebrew/etc/php/8.3. Use following command to verify actual memory limit:

php -i | grep memory_limit