The offending error.

Those of you testing the betas of macOS Monterey may have discovered some PopClip extensions missing, and the message Cannot Install Extension […] No such executable file: /usr/bin/php when trying to install them.

To get the missing extensions back:

  1. Make sure you are running the latest version of PopClip (2021.10).

  2. Install the updated extensions, listed here.

More info, for the curious

This happens because macOS Monterey does not ship with the PHP scripting language runtime, which some extensions need.

Some solutions I considered:

  • Port these extensions to a different scripting language such as Python, Ruby, etc. This seems a very practial short term solution, but none is guaranteed to remain in macOS in future.1
  • Keep them in PHP and require users to install PHP themselves with homebrew or similar. Too many hoops to jump through for non-technical users, for what is supposed to be a simple time-saving tool.
  • Keep them in PHP and ship a PHP runtime with PopClip. — I don’t fancy maintaining a PHP runtime distribution.

Instead, I have updated PopClip to support a new kind of extension, written in JavaScript. PopClip runs the JavaScript code directly, instead of calling out to an external executable. The new extensions are lightning fast, and hopefully now future proof. Having the scripting system built into the app also opens up new possibilities for what PopClip extensions can do.

It’s going to take me some time to port all the remaining PHP extensions to JavaScript. I will keep this postthe forum post updated as I go.

I will also put out documentation for creating your own JavaScript extensions in due course.

Update 30 Sep 2021: Post edited and fleshed out following the release of PopClip 2021.9.

Update 24 Oct 2021: Moved extensions list lo linked forum post.

  1. The macOS 10.15 release notes state: “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.”