PHP не выполняется proxy_fcgi и php_fpm на веб-интерфейсе Zabbix

Я установил php7. 0-fpm и включен мод proxy_fcgi для веб-интерфейса Zabbix.

Однако, когда я пытаюсь получить доступ с любой страницы, я получаю исходный код PHP этой страницы вместо обычной страницы.

Мои конфигурации следующие:

/etc/php/7.0/fpm/pool.d/www.conf
[www]
user= www-data
group = www-data
listen = /run/php/php7.0-fpm.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
pm = dynamic
pm.max_children=10
pm.start_servers =5
pm.min_spare_servers = 2
pm.max_spare_servers = 7
chdir = /usr/share/zabbix/

/etc/apache2/sites-enabled/zabbix.conf 
<VirtualHost *:80>
    Include conf-available/zabbix.conf
    <FilesMatch \.php$>
    SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost/usr/share/zabbix/"
    </FilesMatch>
</VirtualHost>

Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 mime_module (shared)
 mpm_worker_module (shared)
 negotiation_module (shared)
 proxy_module (shared)
 proxy_fcgi_module (shared)
 setenvif_module (shared)
 status_module (shared)

Я получаю только исходный код php во время любого доступа к странице:

<?php
/*
** Zabbix
** Copyright (C) 2001-2017 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/

require_once dirname(__FILE__).'/include/config.inc.php';

В логах все четко, ошибок нет.

Не могли бы вы помочь?

0
задан 18 May 2017 в 19:28
1 ответ

Changed. Похоже, в вашем файле конфигурации есть ошибка. Просто поместите прокси SetHandler ": unix: /run/php/php7.0-fpm.sock | fcgi: // localhost" вместо прокси SetHandler " : unix: /run/php/php7.0-fpm.sock | fcgi: // localhost / usr / share / zabbix / ".

Я проверяю это на своей виртуальной машине, и все работает как надо.

0
ответ дан 5 December 2019 в 08:07

Теги

Похожие вопросы