Want to subscribe to topics you're interested in?
Become a Member

Nginx ngx-php - Embedded php7 or php8 scripting language for nginx module

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by rdan, Feb 4, 2022.

  1. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    5:58 AM
    Mainline
    10.2
  2. buik

    buik “The best traveler is one without a camera.”

    2,026
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,674
    Local Time:
    10:58 PM
    Seems ngx-php is Docker based.

    Apart from Docker, which I am personally not a fan of.
    Seems to be mostly PHP security related.
    Irrespective of whether you want to use this uberhighly.

    Seems as the above can be handled with PHP settings.
    For example, the common used safety practices in PHP.
     
    Last edited: Feb 4, 2022
  3. eva2000

    eva2000 Administrator Staff Member

    54,647
    12,230
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,799
    Local Time:
    7:58 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yes most forms of embedded PHP will perform faster than PHP-FPM as Nginx is actually the bottle neck for PHP-FPM due to how it communicates. But most web apps do not use PHP standalone, you still require a web server to serve the PHP request. Nginx Unit application server NGINX Unit, a Dynamic Application Server | NGINX uses embedded PHP and standalone PHP performs faster than PHP-FPM.

    But once you put Nginx in front of embedded PHP even with Nginx Unit embedded PHP, the performance drops back down to around the same as Nginx + PHP-FPM traditional setup. You can see my very old Nginx Unit tests and also @nfn benchmarks on Centmin Mod for embedded PHP https://community.centminmod.com/threads/nginxs-unit.12803/#post-54893

    As such Centmin Mod did add embedded PHP-FPM support way back https://community.centminmod.com/threads/nginxs-unit.12803/#post-54907 for future Nginx Unit integration plans :)

    And my last Nginx Unit test was back in 2018 https://community.centminmod.com/threads/nginxs-unit.12803/#post-61872. Not sure if Centmin Mod users are ready for Nginx Unit and having to configure server/setups via JSON :D