Welcome! Log In Create A New Profile

Advanced

Re: Run PHP on NGINX

Sergey A. Osokin
October 17, 2023 06:38PM
Hi Jeff,

hope you're doing well.

On Tue, Oct 17, 2023 at 10:50:38AM -0500, Jeff wrote:
> Can PHP code be run using NGINX?
> I am new to web server stuff, so just investigating.

Short answer is no, NGINX by itself can't execute a PHP code.
But here's the important notes here:
1. NGINX has a fastcgi module, [1], that modules allows passing
requests to a FastCGI server;
2. PHP distribution contains PHP FastCGI Process Manager, [2]
is a primary PHP FastCGI implementation.

There many resources in the internet that describes how to
integrate NGINX with a FastCGI server, so I'd recommend to
start a journey from the nginx.org, [3].

Also, you may want to take a look on NGINX Unit, [4],
a lightweight and versatile application runtime hat provides
the essential components for your web application as a single
open-source server.

Hope that helps.


References
----------
1. https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html
2. https://www.php.net/manual/en/install.fpm.php
3. https://nginx.org/en/docs/beginners_guide.html#fastcgi
4. https://unit.nginx.org/configuration/#configuration-php

--
Sergey A. Osokin
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Run PHP on NGINX

Jeff October 17, 2023 11:52AM

Re: Run PHP on NGINX

Sergey A. Osokin October 17, 2023 06:38PM

Re: Run PHP on NGINX

SimpleSamples October 17, 2023 11:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 136
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready