MacOS Terminal says it's running PHP 8.4.4 but localhost says it's running 7.3.27

5 hours ago 1
ARTICLE AD BOX

I installed PHP 8.4.4 using homebrew. Every check I've run says 8.4.4 is installed and is the current version of PHP:

php -v PHP 8.4.4 (cli) (built: Feb 11 2025 15:36:20) (NTS) Copyright (c) The PHP Group Built by Homebrew Zend Engine v4.4.4, Copyright (c) Zend Technologies with Zend OPcache v8.4.4, Copyright (c), by Zend Technologies which php /opt/homebrew/bin/php brew link [email protected] Warning: Already linked: /opt/homebrew/Cellar/php/8.4.4

However, when I navigate to http://localhost, phpinfo() outputs that it's running 7.3.27. Internet searches result in this advice:

Ensure your httpd.conf points to the new PHP module (often /usr/local/lib/httpd/modules/libphp.so or /opt/homebrew/...)

If I open /usr/local/lib/httpd/modules/libphp.so with nano it is gibberish. How can I find the correct httpd.conf file and how do I update it to point to PHP 8.4.4?

Read Entire Article