我最近将我的 cPanel 服务器升级到 EasyApache4,一切都运行良好,直到最近 EasyApache4 自动更新导致我的所有
AddHandler
文件(其中 3 个)中的 PHP 配置 .htaccess
全部被默认值覆盖配置导致我的网站崩溃。我修好了一切,然后昨晚又发生了。如何设置/配置,以便服务器仍然获得自动更新,但不会覆盖/重置 htaccess 文件的组件?或者至少将 .html 扩展名添加回 PHP Addhandler
。
具体来说:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php73 .php .html .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
更新后默认返回此状态(删除 .html 扩展名):
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
我也有同样的问题。
我将自定义 AddHandler 从 cPanel 注释中移出
# php -- BEGIN cPanel-generated handler, do not edit
....
# php -- END cPanel-generated handler, do not edit
我通过MultiPHP手动更改PHP版本,注释中的所有内容都更改为默认设置,但我的自定义AddHandler仍然保持不变。最后.htaccess中有两个AddHandler,不确定是否有任何潜在问题。
另一个帖子说:
然后需要重新启动 Apache。
我已经这样做了三次,但问题不断出现,破坏了服务器上的一堆站点。
我非常想找到解决方案。