<!-- wp:verse -->
<pre class="wp-block-verse"><strong>First install Homebre</strong>w</pre>
<!-- /wp:verse -->

<!-- wp:code -->
<pre class="wp-block-code"><code>/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p><strong>Install stable version of php using Homebrew</strong></p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>brew install php</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>This will start updating Homebrew - Updating tap and Formulae.<br>The following dependencies will normally be installed through the command above. If your differs, the dependencies will install when it is necessary.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>apr, apr-util, argon2, aspell, m4, autoconf, brotli, gettext, libunistring, libidn2, libmetalink, libssh2, c-ares, jemalloc, libev, nghttp2, openldap, rtmpdump, zstd, curl, libtool, unixodbc, freetds, libpng, freetype, fontconfig, jpeg, libtiff, webp, gd, libffi, glib, gmp, icu4c, krb5, libpq, libsodium, libzip, oniguruma, pcre2 and tidy-html5</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>After all dependencies installation</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To enable PHP in Apache add the following to httpd.conf and restart Apache:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>LoadModule php_module /usr/local/opt/php/lib/httpd/modules/libphp.so

&lt;FilesMatch \.php$>
   SetHandler application/x-httpd-php
&lt;/FilesMatch></code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>Finally, check DirectoryIndex includes index.php</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>&nbsp; &nbsp; DirectoryIndex index.php index.html</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>The php.ini and php-fpm.ini file can be found in:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>&nbsp; &nbsp; /usr/local/etc/php/8.0/</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>To have launchd start php now and restart at login:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>&nbsp; brew services start php</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>Or, if you don't want/need a background service you can just run:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>&nbsp; php-fpm</code></pre>
<!-- /wp:code -->