![无效命令‘php_flag’,可能是拼写错误或由服务器配置中未包含的模块定义](https://linux22.com/image/750949/%E6%97%A0%E6%95%88%E5%91%BD%E4%BB%A4%E2%80%98php_flag%E2%80%99%EF%BC%8C%E5%8F%AF%E8%83%BD%E6%98%AF%E6%8B%BC%E5%86%99%E9%94%99%E8%AF%AF%E6%88%96%E7%94%B1%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E7%BD%AE%E4%B8%AD%E6%9C%AA%E5%8C%85%E5%90%AB%E7%9A%84%E6%A8%A1%E5%9D%97%E5%AE%9A%E4%B9%89.png)
我正在尝试设置 PhpPgAdmin。但服务无法启动。
当我得到以下输出时sudo systemctl status httpd.service
:
● httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2020-04-14 12:05:14 CDT; 1s ago
Process: 31293 ExecStart=/usr/bin/httpd -k start -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 31293 (code=exited, status=1/FAILURE)
Apr 14 12:05:14 ardc-pc systemd[1]: Started Apache Web Server.
Apr 14 12:05:14 ardc-pc httpd[31293]: AH00526: Syntax error on line 10 of /etc/httpd/conf/extra/phppgadmin.conf:
Apr 14 12:05:14 ardc-pc httpd[31293]: Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration
Apr 14 12:05:14 ardc-pc systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Apr 14 12:05:14 ardc-pc systemd[1]: httpd.service: Failed with result 'exit-code'.
这是我的 phppgadming.conf 文件:
Alias /phppgadmin "/usr/share/webapps/phppgadmin"
<Directory "/usr/share/webapps/phppgadmin">
DirectoryIndex index.php
AllowOverride All
Options FollowSymlinks
Require all granted
# phppgadmin raises deprecated warnings that lead
# to parsing errors in JS
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
</Directory>
就像PhpPgAdmin说应该是。
我正在运行 Arch Linux。我安装了php,Apache HTTP 服务器一切正常,我看到我的索引页本地主机。但是当我将配置文件添加到PhpPgAdmin服务器停止。我做错了什么?
答案1
我知道问题出在哪里了。
正如维基百科页面所述Apache HTTP 服务器我需要安装 PHP 扩展。按照说明操作,一切正常!