How to install ngx_php7 NGINX module in CentOS/RHEL 7

by ,

We have by far the largest RPM repository with dynamic stable NGINX modules and VMODs for Varnish 4.1 and 6.0 LTS. If you want to install NGINX, Varnish, and lots of useful modules for them, this is your one-stop repository to get all performance-related software.
You have to maintain an active subscription in order to be able to use the repository!

What is ngx_php 7

ngx_php7 is an extension module of high-performance web server nginx, which implements embedded php7 script to process nginx location and variables.

Install with PHP 7.3

yum -y install
yum -y install yum-utils
yum-config-manager --enable remi-php73
yum install nginx-module-php7

Enable in NGINX

Edit your nginx.conf and load the required modules at the top:

load_module modules/;
load_module modules/;

Now you can do fancy PHP stuff in your NGINX configuration:

location /php {
    content_by_php '
       echo "hello ngx_php7";


  • Our module build requires PHP 7.3 and does not support multiple PHP version installations
  • PHP OPCache is not supported by this module (PHP embedded limitation)

    For more information, refer to module’s documentation.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.