PHP Version 7.3.22 to be removed in future macOS

Solution 1:

php -v gives the following response:

WARNING: PHP is not recommended  
PHP is included in macOS for compatibility with legacy software.  
Future versions of macOS will not include PHP.

The release notes for Catalina contain the following remark:

https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes

Scripting Language Runtimes
Deprecations
Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for compatibility with legacy software. Future versions of macOS won’t include scripting language runtimes by default, and might require you to install additional packages. If your software depends on scripting languages, it’s recommended that you bundle the runtime within the app.

In short: macOS continues to include 'legacy' versions of things like Python, Ruby, Perl, and indeed PHP, so that existing code won't break, but Apple is leaving it to the user to install the versions that they want to use.

At the time of writing, 10.16 ('macOS 11') continues to include these languages.

Solution 2:

My understanding of “the plan” is for the OS to not come with PHP included. Apple did a similar transition - removing many open source tools and bundled code bases - from the Server.app

  • https://support.apple.com/en-us/HT208312

Many of the server services went to the OS. Now the OS will be slimmed in the same manner. You will still be able to install PHP as you please / whichever version, but you’ll have to choose whether it comes from the App Store or another vector.

Historically, these take a year or three to implement, but there’s nothing stopping Apple from pulling PHP from 11.0.1 or any other mid-year point release.

Solution 3:

I got really surprised when I first saw this message on Terminal today, but to be honest, as I developer I don't like neither recommend using built-in scripting language like PHP, Ruby or even Apache, I always do and recommend if you need those tools so build and compile it yourself based on your needs, for an example I never use built-in PHP and Ruby because macOs always come with an outdated version of it.