Apache2.4 + PHP7.2 configuration change download site access

Description of the problem: the Apache is working properly, php-fpm work, visit our Web site becomes the download, the site is clearly unable to analyze the cause of php. Communication php-fpm with apache there is a problem.

solution:

If php-fpm using a TCP socket, then add at the end of httpd.conf:

 

<FilesMatch \.php$>
    SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>

 

If you are using unix socket, then add at the end of httpd.conf:

<Proxy "unix:/dev/shm/php-fpm.sock|fcgi://php-fpm">
   ProxySet disablereuse=off
</Proxy>

<FilesMatch \.php$>
   SetHandler proxy:fcgi://php-fpm
</FilesMatch>

 

Finished modifying the configuration file, restart Apache on it. The kind of judgment is listening mode, see php-fpm configuration file on the right.

 

Guess you like

Origin www.cnblogs.com/peteremperor/p/11281273.html