Wednesday, June 16, 2021

macOS 12 Removes PHP

Developer Tools Engineer:

PHP has been removed in macOS Monterey.

Perl, Python 2, and Ruby are still there. Python 3 is only available if you install Xcode. Emacs was removed a release or two ago.


Update (2021-06-16): Tcl also remains.

Update (2021-06-18): See also: Hacker News.

8 Comments RSS · Twitter

That's too bad; makes it harder to deploy useful web apps on your Mac without added software. It's probably better that people use ports though, in truth. Or a VM.

I'm pleased Tcl is safe, for now. MacPorts is written in large part Tcl, but it uses its own custom-built interpreter, so when the day comes, it can still be reinstalled. Tcl is the one true scripting language for me.

Kevin Schumacher

I'm flabbergasted that in 2021 Apple intends to ship Python 2. Is there something in the license for Python 3 that they don't like (i.e. the reason they refused to update bash all those years)? Except that can't be it, because it's included with Xcode. Are there a bunch of internals that rely on Python 2?

Seems like it's a disaster waiting to happen, security-wise.

Bryan Feeney

@Kevin Schumacher
> I'm flabbergasted that in 2021 Apple intends to ship Python 2. Is there something in the license for Python 3 that they don't like

As far as I can gather there are some legacy tools that expect a Python environment to ship with the OS, and -- since they're legacy tools -- they're expecting a legacy Python 2 environment.

Python 2 hit its end of life in 2020: it was maintained up until then due to the communities sluggish transition to Python 3.

I don't think this is a licensing thing, both Python 2 and Python 3 are licensed under the PSF. I think it's more a case that Apple once thought being a UNIX was a selling point, and so bundled in tools which they supported, and now thinks developers should be using third-party tools for this such as HomeBrew, Anaconda, MacPorts etc.

Honestly, as a Python developer, I've not relied on the built-in Apple Python for the last 10 years.

It does worsen the out-of-the-box experience, but I'm not sure there's much of an audience for "has a Python script they need to run, but also doesn't have a package manager or other development tooling installed". Like, this feels like one of the last vestiges of the Bertrand Serlet / NeXT era of making macOS a great workstation OS (see also: Xgrid, Xsan, etc.).

I hope Apple or some third party vastly improves the experience of packaging a script, though. I was trying to do this the other day with a PDF Service — add a code signature, wrap it in a bundle, all that — and it's a bad, bad UX. If it weren't, I think this wouldn't be a big deal at all: just wrap the tool in your custom build of Python, PHP, whathaveyou.

(With, of course, the security issue that this version will likely never receive updates.)

@ Kevin: that's a good point. My Big Sur install here has 2.7.16, which isn't even the last Python 2 release (it seems 2.7.18 from April 2020 is), and they don't intend to do any further security updates. Maybe Apple will move to the Tauthon fork?

(My guess is: yes, there are probably some dependency issues at play here. Yay legacy!)

Shivam Mathur

No one should have used system PHP anyway on macOS, It is an old and insecure version.

I would recommend installing PHP via brew

@Kevin Python 2 is a system framework so there could be stuff that links to it that would break if updated to version 3. I don’t know why they don’t want to ship Python 3, too, though. It’s not very big.

Let's not forget, Apple themselves said that they're not going to ship scripting language runtimes forever:

I would humbly suggest anyone using such tools should definitely avoid Apple's included ones and use a package manager to make deployment of such things much easier. Yes, it is weird Apple does not even update the latest branch they ship in the OS to the latest actual build but Apple has been doing that for years. Their update policies are abysmal.

An interesting though experiment, if I as a developer start running a package manager to install all sorts of non Mac tools, does kind of make me question why I just don't run Linux and save a heaping hunk of money on the whole thing, but that's just me being a contrarian of course.

Leave a Comment