Configuração do PHP-FPM em um LinuxMint

0

Atualmente estou tentando instalar o PHP-FPM em um Linux Mint 18 (Sarah). Eu tenho tentado fazer isso funcionar por horas, se não dias, sem sucesso.

O PHP-FPM não parece ser chamado, pois sempre recebo o código PHP ao consultar uma página, em vez de obter a página esperada, por exemplo:

Consulta:

GET /phpinfo.php

Resposta:

<?php
phpinfo();

Esperado:

phpinfo()
PHP Version => 7.0.8-0ubuntu0.16.04.3

System => Linux[...]

Outra "pista" que o PHP-FPM não é chamada é que, mesmo que eu pare, a resposta da página da Web é a mesma.

Obrigado por qualquer ajuda fornecida!

Aqui estão as especificações:

  • Linux Mint 18
  • Apache 2.4.18
  • PHP 7 (instalado usando o apt-get)
  • PHP-FPM (usando o apt-get)
  • libapache2-mod-fastcgi

Mods ativados:

access_compat.load
actions.conf
actions.load
alias.conf
alias.load
auth_basic.load
authn_core.load
authn_file.load
authz_core.load
authz_host.load
authz_user.load
autoindex.conf
autoindex.load
deflate.conf
deflate.load
dir.conf
dir.load
env.load
fastcgi.conf
fastcgi.load
filter.load
mime.conf
mime.load
mpm_event.conf
mpm_event.load
negotiation.conf
negotiation.load
rewrite.load
setenvif.conf
setenvif.load
status.conf
status.load

Conteúdo do VirtualHost (apenas um habilitado):

<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerName some.server.name
    ServerAdmin webmaster@localhost
    DocumentRoot /opt/git/NetDev/NetworkWebsite/web
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /opt/git/NetDev/NetworkWebsite/web>
        Options FollowSymlinks
        DirectoryIndex app_dev.php
        AllowOverride All
        Require all granted
    </Directory>

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

Conteúdo do arquivo fastcgi.conf:

<IfModule mod_fastcgi.c>
  AddHandler fastcgi-script .fcgi
  #FastCgiWrapper /usr/lib/apache2/suexec
  FastCgiIpcDir /var/lib/apache2/fastcgi
</IfModule>

Conteúdo do arquivo php7.0-fpm.conf (carregado):

# Redirect to local php-fpm if mod_php is not available
<IfModule !mod_php7.c>
    # Enable http authorization headers
    SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1

    <FilesMatch ".+\.ph(p[3457]?|t|tml)$">
        SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost"
    </FilesMatch>
    <FilesMatch ".+\.phps$">
        # Deny access to raw php sources by default
        # To re-enable it's recommended to enable access to the files
        # only in specific virtual host or directory
        Require all denied
    </FilesMatch>
    # Deny access to files without filename (e.g. '.php')
    <FilesMatch "^\.ph(p[3457]?|t|tml|ps)$">
        Require all denied
    </FilesMatch>
</IfModule>

<IfModule mod_fastcgi.c>
    AddHandler php7-fcgi .php
    Action php7-fcgi /php7-fcgi
    Alias /php7-fcgi /usr/lib/cgi-bin/php7-fcgi
    FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi -socket /var/run/php/php7.0-fpm.sock -pass-header Authorization
</IfModule>
    
por NaeiKinDus 14.11.2016 / 16:13

0 respostas