Configure Nginx as reverse proxy for Apache not rendering PHP












0















I'm trying to setup Nginx as a reverse proxy for Apache, from what I've read, it allows nginx to serve static content and Apache handles the backend PHP stuff, but i cant seem to get Apache to render.



I'm on CentOS7, i installed nginx just using yum install nginx, then i installed PHP7.2 by doing the following;



yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php72
yum install php72 php72-php-fpm php72-php-mysqlnd php72-php-opcache php72-php-xml php72-php-xmlrpc php72-php-gd php72-php-mbstring php72-php-json


running php72 -v gives me



PHP 7.2.13 (cli) (built: Dec  8 2018 10:59:58) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.13, Copyright (c) 1999-2018, by Zend
Technologies


I then ran



ln -s /usr/bin/php72 /usr/bin/php


As yum installs the command as php72



I edited nginx.conf and changed the user from nginx to apache and changed the server block to;



server {
listen 80 default;
server_name 108.xxx.xxx.xxx;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
root /var/www/html;
proxy_pass http://127.0.0.1:8080/;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}


I also added /etc/nginx/conf.d/proxy.conf with the following;



proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;


I then installed Apache2 via yum install httpd.



I have then edited the Apache2 httpd.conf file;



- Listen 80
+ Listen 127.0.0.1:8080


I also edited /etc/opt/remi/php72/php-fpm.d/www.conf and changed user and group to apache and also



listen = /var/run/php-fpm.sock
listen.owner = apache
listen.group = apache
listen.mode = 0660


These are the only changes I have made.



I added 2 files to /var/www/html, index.html and index.php ... The index.html works perfect, and when i check with browserspy, it says that it is being served by Nginx, excellent. But when I run the index.php file it displays the actual php code and doesn't render it.



I have never really worked with Apache2 before, so i am unsure of how to look for the error. When i loook in Apache2 modules directory i can't find any PHP modules



ls -lah /etc/httpd/modules/ | grep php


returns nothing at all.



Any help would be really greatful, I have been looking for a solution for days.



Thanks










share|improve this question



























    0















    I'm trying to setup Nginx as a reverse proxy for Apache, from what I've read, it allows nginx to serve static content and Apache handles the backend PHP stuff, but i cant seem to get Apache to render.



    I'm on CentOS7, i installed nginx just using yum install nginx, then i installed PHP7.2 by doing the following;



    yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
    yum-config-manager --enable remi-php72
    yum install php72 php72-php-fpm php72-php-mysqlnd php72-php-opcache php72-php-xml php72-php-xmlrpc php72-php-gd php72-php-mbstring php72-php-json


    running php72 -v gives me



    PHP 7.2.13 (cli) (built: Dec  8 2018 10:59:58) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.13, Copyright (c) 1999-2018, by Zend
    Technologies


    I then ran



    ln -s /usr/bin/php72 /usr/bin/php


    As yum installs the command as php72



    I edited nginx.conf and changed the user from nginx to apache and changed the server block to;



    server {
    listen 80 default;
    server_name 108.xxx.xxx.xxx;

    # Load configuration files for the default server block.
    include /etc/nginx/default.d/*.conf;

    location / {
    root /var/www/html;
    proxy_pass http://127.0.0.1:8080/;
    proxy_redirect off;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    }

    error_page 404 /404.html;
    location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    }
    }


    I also added /etc/nginx/conf.d/proxy.conf with the following;



    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    client_max_body_size 10m;
    client_body_buffer_size 128k;
    proxy_connect_timeout 90;
    proxy_send_timeout 90;
    proxy_read_timeout 90;
    proxy_buffer_size 4k;
    proxy_buffers 4 32k;
    proxy_busy_buffers_size 64k;
    proxy_temp_file_write_size 64k;


    I then installed Apache2 via yum install httpd.



    I have then edited the Apache2 httpd.conf file;



    - Listen 80
    + Listen 127.0.0.1:8080


    I also edited /etc/opt/remi/php72/php-fpm.d/www.conf and changed user and group to apache and also



    listen = /var/run/php-fpm.sock
    listen.owner = apache
    listen.group = apache
    listen.mode = 0660


    These are the only changes I have made.



    I added 2 files to /var/www/html, index.html and index.php ... The index.html works perfect, and when i check with browserspy, it says that it is being served by Nginx, excellent. But when I run the index.php file it displays the actual php code and doesn't render it.



    I have never really worked with Apache2 before, so i am unsure of how to look for the error. When i loook in Apache2 modules directory i can't find any PHP modules



    ls -lah /etc/httpd/modules/ | grep php


    returns nothing at all.



    Any help would be really greatful, I have been looking for a solution for days.



    Thanks










    share|improve this question

























      0












      0








      0








      I'm trying to setup Nginx as a reverse proxy for Apache, from what I've read, it allows nginx to serve static content and Apache handles the backend PHP stuff, but i cant seem to get Apache to render.



      I'm on CentOS7, i installed nginx just using yum install nginx, then i installed PHP7.2 by doing the following;



      yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
      yum-config-manager --enable remi-php72
      yum install php72 php72-php-fpm php72-php-mysqlnd php72-php-opcache php72-php-xml php72-php-xmlrpc php72-php-gd php72-php-mbstring php72-php-json


      running php72 -v gives me



      PHP 7.2.13 (cli) (built: Dec  8 2018 10:59:58) ( NTS )
      Copyright (c) 1997-2018 The PHP Group
      Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
      with Zend OPcache v7.2.13, Copyright (c) 1999-2018, by Zend
      Technologies


      I then ran



      ln -s /usr/bin/php72 /usr/bin/php


      As yum installs the command as php72



      I edited nginx.conf and changed the user from nginx to apache and changed the server block to;



      server {
      listen 80 default;
      server_name 108.xxx.xxx.xxx;

      # Load configuration files for the default server block.
      include /etc/nginx/default.d/*.conf;

      location / {
      root /var/www/html;
      proxy_pass http://127.0.0.1:8080/;
      proxy_redirect off;
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      }

      error_page 404 /404.html;
      location = /40x.html {
      }

      error_page 500 502 503 504 /50x.html;
      location = /50x.html {
      }
      }


      I also added /etc/nginx/conf.d/proxy.conf with the following;



      proxy_redirect off;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      client_max_body_size 10m;
      client_body_buffer_size 128k;
      proxy_connect_timeout 90;
      proxy_send_timeout 90;
      proxy_read_timeout 90;
      proxy_buffer_size 4k;
      proxy_buffers 4 32k;
      proxy_busy_buffers_size 64k;
      proxy_temp_file_write_size 64k;


      I then installed Apache2 via yum install httpd.



      I have then edited the Apache2 httpd.conf file;



      - Listen 80
      + Listen 127.0.0.1:8080


      I also edited /etc/opt/remi/php72/php-fpm.d/www.conf and changed user and group to apache and also



      listen = /var/run/php-fpm.sock
      listen.owner = apache
      listen.group = apache
      listen.mode = 0660


      These are the only changes I have made.



      I added 2 files to /var/www/html, index.html and index.php ... The index.html works perfect, and when i check with browserspy, it says that it is being served by Nginx, excellent. But when I run the index.php file it displays the actual php code and doesn't render it.



      I have never really worked with Apache2 before, so i am unsure of how to look for the error. When i loook in Apache2 modules directory i can't find any PHP modules



      ls -lah /etc/httpd/modules/ | grep php


      returns nothing at all.



      Any help would be really greatful, I have been looking for a solution for days.



      Thanks










      share|improve this question














      I'm trying to setup Nginx as a reverse proxy for Apache, from what I've read, it allows nginx to serve static content and Apache handles the backend PHP stuff, but i cant seem to get Apache to render.



      I'm on CentOS7, i installed nginx just using yum install nginx, then i installed PHP7.2 by doing the following;



      yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
      yum-config-manager --enable remi-php72
      yum install php72 php72-php-fpm php72-php-mysqlnd php72-php-opcache php72-php-xml php72-php-xmlrpc php72-php-gd php72-php-mbstring php72-php-json


      running php72 -v gives me



      PHP 7.2.13 (cli) (built: Dec  8 2018 10:59:58) ( NTS )
      Copyright (c) 1997-2018 The PHP Group
      Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
      with Zend OPcache v7.2.13, Copyright (c) 1999-2018, by Zend
      Technologies


      I then ran



      ln -s /usr/bin/php72 /usr/bin/php


      As yum installs the command as php72



      I edited nginx.conf and changed the user from nginx to apache and changed the server block to;



      server {
      listen 80 default;
      server_name 108.xxx.xxx.xxx;

      # Load configuration files for the default server block.
      include /etc/nginx/default.d/*.conf;

      location / {
      root /var/www/html;
      proxy_pass http://127.0.0.1:8080/;
      proxy_redirect off;
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      }

      error_page 404 /404.html;
      location = /40x.html {
      }

      error_page 500 502 503 504 /50x.html;
      location = /50x.html {
      }
      }


      I also added /etc/nginx/conf.d/proxy.conf with the following;



      proxy_redirect off;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      client_max_body_size 10m;
      client_body_buffer_size 128k;
      proxy_connect_timeout 90;
      proxy_send_timeout 90;
      proxy_read_timeout 90;
      proxy_buffer_size 4k;
      proxy_buffers 4 32k;
      proxy_busy_buffers_size 64k;
      proxy_temp_file_write_size 64k;


      I then installed Apache2 via yum install httpd.



      I have then edited the Apache2 httpd.conf file;



      - Listen 80
      + Listen 127.0.0.1:8080


      I also edited /etc/opt/remi/php72/php-fpm.d/www.conf and changed user and group to apache and also



      listen = /var/run/php-fpm.sock
      listen.owner = apache
      listen.group = apache
      listen.mode = 0660


      These are the only changes I have made.



      I added 2 files to /var/www/html, index.html and index.php ... The index.html works perfect, and when i check with browserspy, it says that it is being served by Nginx, excellent. But when I run the index.php file it displays the actual php code and doesn't render it.



      I have never really worked with Apache2 before, so i am unsure of how to look for the error. When i loook in Apache2 modules directory i can't find any PHP modules



      ls -lah /etc/httpd/modules/ | grep php


      returns nothing at all.



      Any help would be really greatful, I have been looking for a solution for days.



      Thanks







      php apache nginx centos centos7






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 3 at 10:21









      CodeCodeCodeCodeCodeCodeCodeCode

      3991314




      3991314
























          1 Answer
          1






          active

          oldest

          votes


















          1














          Nginx can definitely execute PHP scripts without the need of proxying back to Apache.
          The reason why you're seeing just the PHP code rather than the website, is because your Apache configuration likely does not have the PHP module enabled.



          You can do this by running yum --enablerepo=remi install php and running service apache2 restart to restart the server with the new configuration.
          Installing the base PHP packages also adds the required modules for PHP files to be executed by Apache.



          This should allow your server to start executing the PHP scripts as you expect.



          If you'd like to instead run your PHP website via Nginx instead, you'll need to make some slight modifications to your Nginx configuration.



          Firstly, you'll need to replace your location block to use the files on your local filesystem and then point any .php file to run using PHP-FPM.



          location / {
          root /var/www/html;
          try_files $uri $uri/ =404;
          }

          location ~ .php$ {
          fastcgi_pass unix:/var/run/php-fpm.sock;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
          }





          share|improve this answer


























          • Hey Steven, I get a command not found when running the a2enmod command, i am on CentOS7, i believe that is a debian based command... I would like to run php through Apache and not nginx

            – CodeCodeCodeCode
            Jan 3 at 10:51













          • Hey, my bad, didn't realise a2nmod was a debian specific command. You should be able to resolve the original issue by installing the base PHP packages yum --enablerepo=remi install php and restarting httpd.

            – Steven T
            Jan 3 at 11:56













          • I have already used the remi-php72 repo to install PHP 7.2 .. See the top of the post

            – CodeCodeCodeCode
            Jan 3 at 12:07











          • Installing the php72-php package does install PHP, but does not include the Apache modules for PHP for some reason. Installing the base PHP package will install the Apache modules allowing your server to start using PHP7.

            – Steven T
            Jan 3 at 12:10













          • Interesting ... That worked ... Thank you for that

            – CodeCodeCodeCode
            Jan 3 at 12:14











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54020326%2fconfigure-nginx-as-reverse-proxy-for-apache-not-rendering-php%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Nginx can definitely execute PHP scripts without the need of proxying back to Apache.
          The reason why you're seeing just the PHP code rather than the website, is because your Apache configuration likely does not have the PHP module enabled.



          You can do this by running yum --enablerepo=remi install php and running service apache2 restart to restart the server with the new configuration.
          Installing the base PHP packages also adds the required modules for PHP files to be executed by Apache.



          This should allow your server to start executing the PHP scripts as you expect.



          If you'd like to instead run your PHP website via Nginx instead, you'll need to make some slight modifications to your Nginx configuration.



          Firstly, you'll need to replace your location block to use the files on your local filesystem and then point any .php file to run using PHP-FPM.



          location / {
          root /var/www/html;
          try_files $uri $uri/ =404;
          }

          location ~ .php$ {
          fastcgi_pass unix:/var/run/php-fpm.sock;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
          }





          share|improve this answer


























          • Hey Steven, I get a command not found when running the a2enmod command, i am on CentOS7, i believe that is a debian based command... I would like to run php through Apache and not nginx

            – CodeCodeCodeCode
            Jan 3 at 10:51













          • Hey, my bad, didn't realise a2nmod was a debian specific command. You should be able to resolve the original issue by installing the base PHP packages yum --enablerepo=remi install php and restarting httpd.

            – Steven T
            Jan 3 at 11:56













          • I have already used the remi-php72 repo to install PHP 7.2 .. See the top of the post

            – CodeCodeCodeCode
            Jan 3 at 12:07











          • Installing the php72-php package does install PHP, but does not include the Apache modules for PHP for some reason. Installing the base PHP package will install the Apache modules allowing your server to start using PHP7.

            – Steven T
            Jan 3 at 12:10













          • Interesting ... That worked ... Thank you for that

            – CodeCodeCodeCode
            Jan 3 at 12:14
















          1














          Nginx can definitely execute PHP scripts without the need of proxying back to Apache.
          The reason why you're seeing just the PHP code rather than the website, is because your Apache configuration likely does not have the PHP module enabled.



          You can do this by running yum --enablerepo=remi install php and running service apache2 restart to restart the server with the new configuration.
          Installing the base PHP packages also adds the required modules for PHP files to be executed by Apache.



          This should allow your server to start executing the PHP scripts as you expect.



          If you'd like to instead run your PHP website via Nginx instead, you'll need to make some slight modifications to your Nginx configuration.



          Firstly, you'll need to replace your location block to use the files on your local filesystem and then point any .php file to run using PHP-FPM.



          location / {
          root /var/www/html;
          try_files $uri $uri/ =404;
          }

          location ~ .php$ {
          fastcgi_pass unix:/var/run/php-fpm.sock;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
          }





          share|improve this answer


























          • Hey Steven, I get a command not found when running the a2enmod command, i am on CentOS7, i believe that is a debian based command... I would like to run php through Apache and not nginx

            – CodeCodeCodeCode
            Jan 3 at 10:51













          • Hey, my bad, didn't realise a2nmod was a debian specific command. You should be able to resolve the original issue by installing the base PHP packages yum --enablerepo=remi install php and restarting httpd.

            – Steven T
            Jan 3 at 11:56













          • I have already used the remi-php72 repo to install PHP 7.2 .. See the top of the post

            – CodeCodeCodeCode
            Jan 3 at 12:07











          • Installing the php72-php package does install PHP, but does not include the Apache modules for PHP for some reason. Installing the base PHP package will install the Apache modules allowing your server to start using PHP7.

            – Steven T
            Jan 3 at 12:10













          • Interesting ... That worked ... Thank you for that

            – CodeCodeCodeCode
            Jan 3 at 12:14














          1












          1








          1







          Nginx can definitely execute PHP scripts without the need of proxying back to Apache.
          The reason why you're seeing just the PHP code rather than the website, is because your Apache configuration likely does not have the PHP module enabled.



          You can do this by running yum --enablerepo=remi install php and running service apache2 restart to restart the server with the new configuration.
          Installing the base PHP packages also adds the required modules for PHP files to be executed by Apache.



          This should allow your server to start executing the PHP scripts as you expect.



          If you'd like to instead run your PHP website via Nginx instead, you'll need to make some slight modifications to your Nginx configuration.



          Firstly, you'll need to replace your location block to use the files on your local filesystem and then point any .php file to run using PHP-FPM.



          location / {
          root /var/www/html;
          try_files $uri $uri/ =404;
          }

          location ~ .php$ {
          fastcgi_pass unix:/var/run/php-fpm.sock;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
          }





          share|improve this answer















          Nginx can definitely execute PHP scripts without the need of proxying back to Apache.
          The reason why you're seeing just the PHP code rather than the website, is because your Apache configuration likely does not have the PHP module enabled.



          You can do this by running yum --enablerepo=remi install php and running service apache2 restart to restart the server with the new configuration.
          Installing the base PHP packages also adds the required modules for PHP files to be executed by Apache.



          This should allow your server to start executing the PHP scripts as you expect.



          If you'd like to instead run your PHP website via Nginx instead, you'll need to make some slight modifications to your Nginx configuration.



          Firstly, you'll need to replace your location block to use the files on your local filesystem and then point any .php file to run using PHP-FPM.



          location / {
          root /var/www/html;
          try_files $uri $uri/ =404;
          }

          location ~ .php$ {
          fastcgi_pass unix:/var/run/php-fpm.sock;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
          }






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 3 at 11:57

























          answered Jan 3 at 10:48









          Steven TSteven T

          1544




          1544













          • Hey Steven, I get a command not found when running the a2enmod command, i am on CentOS7, i believe that is a debian based command... I would like to run php through Apache and not nginx

            – CodeCodeCodeCode
            Jan 3 at 10:51













          • Hey, my bad, didn't realise a2nmod was a debian specific command. You should be able to resolve the original issue by installing the base PHP packages yum --enablerepo=remi install php and restarting httpd.

            – Steven T
            Jan 3 at 11:56













          • I have already used the remi-php72 repo to install PHP 7.2 .. See the top of the post

            – CodeCodeCodeCode
            Jan 3 at 12:07











          • Installing the php72-php package does install PHP, but does not include the Apache modules for PHP for some reason. Installing the base PHP package will install the Apache modules allowing your server to start using PHP7.

            – Steven T
            Jan 3 at 12:10













          • Interesting ... That worked ... Thank you for that

            – CodeCodeCodeCode
            Jan 3 at 12:14



















          • Hey Steven, I get a command not found when running the a2enmod command, i am on CentOS7, i believe that is a debian based command... I would like to run php through Apache and not nginx

            – CodeCodeCodeCode
            Jan 3 at 10:51













          • Hey, my bad, didn't realise a2nmod was a debian specific command. You should be able to resolve the original issue by installing the base PHP packages yum --enablerepo=remi install php and restarting httpd.

            – Steven T
            Jan 3 at 11:56













          • I have already used the remi-php72 repo to install PHP 7.2 .. See the top of the post

            – CodeCodeCodeCode
            Jan 3 at 12:07











          • Installing the php72-php package does install PHP, but does not include the Apache modules for PHP for some reason. Installing the base PHP package will install the Apache modules allowing your server to start using PHP7.

            – Steven T
            Jan 3 at 12:10













          • Interesting ... That worked ... Thank you for that

            – CodeCodeCodeCode
            Jan 3 at 12:14

















          Hey Steven, I get a command not found when running the a2enmod command, i am on CentOS7, i believe that is a debian based command... I would like to run php through Apache and not nginx

          – CodeCodeCodeCode
          Jan 3 at 10:51







          Hey Steven, I get a command not found when running the a2enmod command, i am on CentOS7, i believe that is a debian based command... I would like to run php through Apache and not nginx

          – CodeCodeCodeCode
          Jan 3 at 10:51















          Hey, my bad, didn't realise a2nmod was a debian specific command. You should be able to resolve the original issue by installing the base PHP packages yum --enablerepo=remi install php and restarting httpd.

          – Steven T
          Jan 3 at 11:56







          Hey, my bad, didn't realise a2nmod was a debian specific command. You should be able to resolve the original issue by installing the base PHP packages yum --enablerepo=remi install php and restarting httpd.

          – Steven T
          Jan 3 at 11:56















          I have already used the remi-php72 repo to install PHP 7.2 .. See the top of the post

          – CodeCodeCodeCode
          Jan 3 at 12:07





          I have already used the remi-php72 repo to install PHP 7.2 .. See the top of the post

          – CodeCodeCodeCode
          Jan 3 at 12:07













          Installing the php72-php package does install PHP, but does not include the Apache modules for PHP for some reason. Installing the base PHP package will install the Apache modules allowing your server to start using PHP7.

          – Steven T
          Jan 3 at 12:10







          Installing the php72-php package does install PHP, but does not include the Apache modules for PHP for some reason. Installing the base PHP package will install the Apache modules allowing your server to start using PHP7.

          – Steven T
          Jan 3 at 12:10















          Interesting ... That worked ... Thank you for that

          – CodeCodeCodeCode
          Jan 3 at 12:14





          Interesting ... That worked ... Thank you for that

          – CodeCodeCodeCode
          Jan 3 at 12:14




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54020326%2fconfigure-nginx-as-reverse-proxy-for-apache-not-rendering-php%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas