简体   繁体   English

将 AWS Elastic Beanstalk 从 PHP 5.6 升级到 7.4 导致 .htaccess 日志中出现“php_value”错误

[英]Upgrading AWS Elastic Beanstalk from PHP 5.6 to 7.4 caused 'php_value' error in .htaccess logs

I just upgraded from AWS Elastic Beanstalk from PHP 5.6 to PHP 7.4, but now I am getting errors in the logs related to .htaccess and php_value being unrecognized.我刚刚从 AWS Elastic Beanstalk 从 PHP 5.6 升级到 PHP 7.4,但现在我在日志中收到与 .htaccess 和php_value相关的错误无法识别。 How are these related?这些有什么关系?

Update: Since fixed the problem but the error was more or less:更新:由于解决了问题,但错误或多或少:

.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration

When you moved from Elastic Beanstalk's PHP 5.6 AMI you also moved from Amazon Linux to Amazon Linux 2 and from using当您从 Elastic Beanstalk 的 PHP 5.6 AMI 迁移时,您也从 Amazon Linux 迁移到 Amazon Linux 2 并不再使用

Apache + mod_php

to using使用

nginx + FastCGI Process Manager (FPM)

by default.默认情况下。

You can configure your new setup to use Apache instead of nginx, but that still leaves you with FPM instead of mod_php.您可以将新设置配置为使用 Apache 而不是 nginx,但这仍然让您使用 FPM 而不是 mod_php。 mod_php, being run as part of Apache, let you use php.ini directives like php_value in the Apache .htaccess files. mod_php 作为 Apache 的一部分运行,允许您在 Apache .htaccess 文件中使用 php.ini 指令,如php_value FPM does not let you do this, so you need to either remove those directives or move them to php.ini (or the equivalent Elastic Beanstalk extension/override mechanism), or translate the settings into the equivalent FPM settings, (though FPM seems to support all the php.ini directives in its config file already). FPM 不允许您这样做,因此您需要删除这些指令或将它们移动到 php.ini(或等效的 Elastic Beanstalk 扩展/覆盖机制),或将设置转换为等效的 FPM 设置,(尽管 FPM 似乎已经支持其配置文件中的所有 php.ini 指令)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM