macOS 12.0 -where oh where is PHP

PHP seems to be missing from this release.

  • No one should use system PHP anyway on macOS, It is an old and insecure version. I would recommend installing PHP via brew  https://github.com/shivammathur/homebrew-php

  • Hi, I installed PHP via brew from shivammathur, (macOS Monterrey) How do I activate PHP? It's not being interpreted, what I see is the code when I load a PHP file. Thanks in advance

  • Have you tried making changes in httpd.conf file to read php files ?

Replies

PHP has been removed in macOS Monterey.

  • That would be unfortunate. How can we convince you'll to put it back in the release.

  • brew install php

  • I have been trying to compile it myself. Instructions at https://mac-dev-env.patrickbougie.com/php/ are close. Perhaps some trial and error. First issue is apsx is missing from apache

This is a giant step backwards. One of the nice things about macOS is the built in apache including PHP. Please reconsider this.

  • It's been deprecated since 10.15 https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes#Scripting-Language-Runtimes

    12.0 is a major release, so Apple did the right thing.

  • This is a giant step forward. The version of Php that Apple ships with is almost always an outdated version, without the useful extensions. For anyone working with php, there are now much easier ways to install and manage multiple versions at once (brew, docker etc) without having to deal with outdated and conflicting versions. Plus, it cleans up the system for the rest of us. Thanks Apple! good call

  • Also running PHP binary would've given hints

    ⇒ /usr/bin/php -v WARNING: PHP is not recommended PHP is included in macOS for compatibility with legacy software. Future versions of macOS will not include PHP. PHP 7.3.24-(to be removed in future macOS) (cli) (built: May 8 2021 09:40:37) ( NTS )

Add a Comment

MAMP (https://www.mamp.info/en/mac/) is also an option.

  • Option, yes. A good one? That's debatable. ;) I would strongly encourage folks to look into Lando and Docker (or similar) for local development. PHP is useful to have for some CLI stuff, but if you're doing more than that, you're best off containerizing your stuff for the sake of consistency.

Add a Comment

No one should use system PHP anyway on macOS, It is an old and insecure version. I would recommend installing PHP via brew  https://github.com/shivammathur/homebrew-php

  • Hi, I installed PHP from this repository, what do I have to do now to activate PHP? I'm using macOS Monterrey

  • A little search will take you to pages on how to configure apache to enable PHP. https://websitebeaver.com/set-up-localhost-on-macos-high-sierra-apache-mysql-and-php-7-with-sslhttps

    The recommended version is PHP 8.

Add a Comment

Can I add my tuppence-worth as another request for PHP to return to macOS 12. My first thought was that it was a licensing issue, but PHP uses a BSD-style license, so I can't understand the rationale for removing it.

  • The rationale for removing it is that people should be able to choose what to install (or not install) on their system to reduce version conflicts and to remove security flaws, as well as to have a smaller OS footprint. Users should be able to select the version(s) they prefer. Embedding a specific version in the OS exposes users to all the security issues of that version.

Add a Comment

Via MacPorts ( https://www.macports.org/ ):

port install php
  • Have you actually tried that?

  • It doesn't work. Also, I second telling folks to port or brew is asinine, considering there's no consensus on which package manager to trust or is more reliable.

Add a Comment

It seems that it would be easier for one person at apple to upgrade php, rather then millions of users having to do so. Laziness.

  • Software get updated all the time. Users / devs might need or want versions other than that provided by Apple. Including a specific version of software in an OS exposes users to its security vulnerabilities, even if they don’t need that software or that version of it. It provides ample opportunities for version conflicts if someone wants to use a different version than the built in. It also bloats the distribution size.

    Apple won’t (& shouldn’t) release a new OS every time se third-party software is updated. But users might want to upgrade themselves. Even if Apple did update macOS with every new third-party software version, changing the version of languages / frameworks all the time would frequently break programs that relied on them.

    Apple might also object to new licenses in newer versions of a distribution, like how they keep providing an ancient version of bash.

    Please stop embarrassing yourself with your uninformed posts on this topic.

    If you want to install software, and to either pin it to a specific version or to easily get the newest, use one of the many software managers out there.

Add a Comment

The situation is similar for Perl. You can install perl separately via homebrew or macports, or via plenv (https://github.com/tokuhirom/plenv) or perlbrew (perlbrew.pl). This is preferred anyway since in the last few OSX releases, Apple has edited some of the internal Perl toolchain modules (such as ExtUtils::MakeMaker) in a broken way without talking to the developer team (or even responding to repeated pleas to fix their broken changes).

100% the right move. Dockerize your app and move on.

docker pull php:alpine
  • What does this even mean?

    Besides, docker: Command not found.

  • install docker first tuxedobob0. docker.com

Add a Comment

O.k., they removed php... some call it a good thing, some call it a bad thing. But; why remove PHP, but keep apache?

  • Because Apache can serve even non-PHP web apps.

Add a Comment

Buna hiç gerek yoktu. İşi zora sokmak demek bu. Php eski ve kullanılmayan bir dil değil.. Web tabanlı en gelişmiş dillerden biri durumunda ve güncellenmeye devam ediliyor. Apple desteğini çekerek iyi yapmadı. Umarım konu hakkında gerekli iyileştirmeleri yaparlar ve php desteği geri gelir.