------- Original Message -------
On Tuesday, October 17th, 2023 at 16:50, Jeff <jeff at ForerunnerTV.com> wrote:
> Can PHP code be run using NGINX?
>
>
Yes of course.
There are surely thousands of how-to's on Google already ?
Its not difficult, only about 5 lines in the config file.
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
The original HTML had forms. Forms still exist for HTML. A form can
specify that a different HTML file be shown when the form is submitted.
Between the the form submission and the showing of the second HTML file,
a script, called a CGI script, can be executed to process the form. And
that is how server-side languages such as PHP are executed. The original
CGI is inefficient. FastCGI is more efficient. Therefore PHP websites
execute PHP using FastCGI. Other servers such as Apache and IIS use
FastCGI or something very similar.
Jeff wrote on 10/17/2023 8:50 AM:
> Can PHP code be run using NGINX?
>
> I am new to web server stuff, so just investigating.
>
> Thanks
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> https://mailman.nginx.org/mailman/listinfo/nginx