What I’m trying to do: get the nginx web server to handle php files
Where I’m stuckserver is set up and handles html pages, but rejects php and doesn’t even display the embedded <?php ?> characters as text in an html page.
What I’ve already tried: I started with the native Apache server and moved to nginx and neither seem to like php. Followed a bunch of YouTube videos and I am obviously missing something.
Oh, both php@8.4 and the latest nginx were installed with hombres!
Has anyone been successful getting php tp render on nginx on the Mac mini m4?
Are you using php-fpm on the system? The standard approach for running php applications with nginx is to leverage php-fpm to execute the PHP scripts and configure the fastcgi module in NGINX.
You will need to configure NGINX to use the fastcgi module to proxy the requests to php-fpm. There are a lot of examples on how to do this online(including the link in my earlier post. Here is one I found specifically for doing this on OSX which might help. You will need to adjust the fastcgi_pass directive to point to the correct port that php-fpm is configured for on your system.
Got it! Thank you. But ChatGPT did all the work to find the errors and correct paths to tie php@8.4 to nginx.
Every link I found points to php-rpm. I chased around hunting for that and never found a reference to it on my machine. It must be used, but it isn’t obvious. Lots of time trying to figure it out.