macOS 12.0 -where oh where is PHP

PHP seems to be missing from this release.

PHP has been removed in macOS Monterey.

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

13

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

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

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

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.

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

port install php

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.

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

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 ?

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

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.

I have installed php and many other items using Homebrew. It updates brew and many other things while it's working and that appears fine. I don't see any error messages or conflicts or requests for root password nor anything else. However, when it's finished, I will try to load http://127.0.0.1/phpinfo.php which is nothing more than When I load this page in Firefox, it shows nothing but a blank page. If I view source, it shows the PHP code which tells me it was not interpreted and run on the server as it should have. It has been this way since several upgrades ago. It used to work fine, then all of a sudden it stopped and has behaved as described ever since. Every time I do another Mac OS system upgrade, I think it will fix itself but it never does. I would like to know a list of steps to see if it runs at all, to see if it runs incorrectly and to fix it if possible. This has moved to the front of my attention because I just upgraded to Mac OS Monterey 12.0.1.

The original post had the php code in it. It was part of the sentence, "which is nothing more than..." Right there is where I showed the contents of the page I load to test if php is working.

It would be good if Apple allows custom installation that makes php executable into /usr/bin. Right now, the situation is breaking some tools, such as phpcs in PHPStorm. I tried to solve it by installing PHP with Homebrew, and it doesn't solve the problem.

What upsets me about the move to big sur and then monterey is that the upgrade program should check that i have apache, php and mysql and if it finds that there it should stop and say: hey man, this upgrade is going to create problems for you ... do you want to think about it before you proceed?

So what I'm going top do now is upload the (daily) backedup MySQL database to a hosting service that will also support PHP. Then I'll find the time to work out how to migrate my admin systems to Monterey - and then buy a new Macbook Pro - after I know how to migrate to that environment.

PHP is not insecure if you use a supported version: https://www.php.net/supported-versions.php

Apple is not the only company to stop bundling it and give the responsibility to the end user. Claris also used to ship PHP with FileMaker Server and removed that. So Claris had to provide instructions to get your own php set up for custom web publishing in the Claris Engineering blog: https://support.claris.com/s/answerview?anum=000035470&language=en_US

These instructions were helpful, as were Tim Perfitt's instructions at Two Canoes for installing PHP on Monterey as he did for his MDS project: https://twocanoes.com/knowledge-base/installing-php-7-on-macos-12-monterey/

Of course, in Monterey you have to code-sign the PHP you install. But it is not so hard if you follow the method from Rich Trouton at "Der Flounder": https://derflounder.wordpress.com/2019/04/10/notarizing-automator-applications/

Using all this, I have had great success installing my own PHP on both my macOS FileMaker Server for custom PHP web publishing and my macOS Web Server (for a web site, munki server and munkireport server and various remote proxies. (both Macs on Monterey).

I presented on this topic along with my methodology including a "recipe" at the MacDevOps YVR conference 2022: https://www.youtube.com/watch?v=XzxxLHojXhk&t=1s

In short, PHP on the Mac still lives - but its up to the end user to maintain it.

This is simply frustrating. After wasting 3 hours of time I came to know that there is no php installed. ***! Apple. Why wouldn't you include php by default in a linux clone? Here is another dumb thing. I install and fix php in previous version only to be wiped out by next freaking update. ******* waste of my and thousands of other users. Apple sucks. Get it installed in next upgrade and leave us in peace.

This command should fix it

brew install php

َ

thanks to @LH16

macOS 12.0 -where oh where is PHP
 
 
Q