The following steps will describe how to build PHP from source including PHP's Apache module as it is no longer part of macOS starting with macOS Monterey.
If this is for a development environment, you can simply install PHP with Homebrew using the command brew install php
. This guide is for cases where you need a more portable PHP without heavily dependening on external libraries.
https://dev.to/ramsey/using-clion-with-php-src-4me0
- Install Homebrew
- Install the following Homebrew packages
brew install libxml2 libiconv apr apr-util bison re2c python capstone compiledb pkg-config perl httpd