MACOS12 Plus has removed PHP from Apache - Virtualmin Not Picking Up Brew Config

SYSTEM INFORMATION
OS type and version MACOS-MONTERREY
Webmin version LATEST
Virtualmin version LATEST
Webserver version APACHE 2.4
Related packages PHP/PHP-FPM

Jamey on MACOS12 PHP is no longer bundled and is not included in the HTTPD.CONF.
When I install Brew install php@8.3 it installs php, and php-fpm. I have enabled fcgi module in apache file which still exists, and configured the Webmin PHP module to find php8.3…

But in VirtualMin with everything loaded the webserver config is not picking up the PHP config.
Mod PHP is no longer in the MACOS build… so we need some kind of script to rebuild it…

There is a guy who has a source build which includes the old MACOS apache stack with. PHP
but its not in the base config.

https://twocanoes.com/knowledge-base/installing-php-7-on-macos-12-monterey/

New PHP from brew is in /usr/local/etc/php/8.3/ And target PHP install with FPM is in /usr/local/cellar/php/8.3/ where the lib’s and binaries are stored.

Any thoughts on what is necessary to get this working with Virtualmin on MACOS from latest tarballs @2.11 on Webmin and VirtualMin module loaded manually.

I would strongly recommend against using mod_php on any OS.

What happens when you do Re-Check Configuration? I assume it just can’t find PHP and PHP-FPM? You may need to modify php-lib.pl to know where your stuff is installed. There’s not consistent way to figure it out, so we just have a big list of possibilities. Since MacOS isn’t used on servers to any notable degree, we don’t know what one looks like.

The code for detecting PHP locations is probably in this general area:

And, PHP here: virtualmin-gpl/php-lib.pl at 2cec60d89266b23f0512ef1bd3f42d12f27c3a02 · virtualmin/virtualmin-gpl · GitHub

And, somewhere in here: virtualmin-gpl/php-lib.pl at 2cec60d89266b23f0512ef1bd3f42d12f27c3a02 · virtualmin/virtualmin-gpl · GitHub

Several locations in that file, actually.

Ok I have resolved this problem:

By using Brew or MacPorts you can install PHP8.3 which includes FPM.

Then you just need to update /etc/apache/httpd.conf

with the directions on the PHP website.

After I did this and restarted apache on MACOS VirtualMin could find it.

you can mark this as closed…
BTW Homebrew command is:
brew install php@8.3 or php@8.x

Mac Ports snytax is:
sudo port install php@8.3

php verification is ps -ef | grep fpm

1 Like

Mark this post as the solution no one else needs to do it for you

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.