NGINX Apache 设置无法运行 Apache 函数

NGINX Apache 设置无法运行 Apache 函数

我在 Apache 前面设置了 NGINX 来传递请求。对于我的一个子域,我让流量先通过 NGINX,然后通过 Apache,因为此子域上的 PHP 系统需要 Apache 才能运行(需要诸如 之类的功能apache_get_modules)。对于主域/其他子域,数据直接通过 NGINX。我为此使用了 PHP-FPM。

但是,在这个将请求传递给 Apache 的子域上,我有一个安装程序来安装我想要的系统。但是我收到此错误:

Fatal error: Uncaught Error: Call to undefined function apache_get_version() in /var/www/subdomain.example.com/html/installer/index.php:80 Stack trace: #0 /var/www/subdomain.example.com/html/installer/index.php(240): checkDependencies() #1 {main} thrown in /var/www/subdomain.example.com/html/installer/index.php on line 80

因此子域上的应用程序无法访问正常运行的 apache 函数。我正在运行 PHP 7.3-FPM,并且已将其配置为使用libapache2-mod-fastcgietc与 apache 一起工作。

该子域名的 phpinfo 页面显示:

Server API: FPM/FastCGI

$_SERVER['SERVER_SOFTWARE']: Apache/2.4.25 (Debian)

这告诉我们该页面正在按照预期在 NGINX 之后通过 Apache 提供服务,但是无法加载如上所述的 apache 功能?

是不是缺少了什么?你能帮我指出正确的方向吗?非常感谢,任何支持都有帮助。

相关内容