sit*_*443 4 php apache debugging http-headers symfony-1.4
我一直在Centos 6.7服务器上使用qdPM v9.0(来自qdpm/core/apps/qdPM/config/app.yml)和PHP 7.0.6以及apache 2.2.x和MariaDB 5.5.x一年多没有任何的问题.它似乎使用传统的Symfony 1.4.
我尝试安装Let的加密SSL证书,并将此升级的Apache/httpd安装到2.2.15,PHP或MariaDB版本没有变化.
在SSL证书安装后重新启动httpd时,我突然收到500内部服务器错误,并且httpd错误日志显示:
...
[Wed Aug 09 14:55:22 2017] [error] [client x.x.x.x] Empty response header name, aborting request
[Wed Aug 09 14:55:32 2017] [error] [client x.x.x.x] Empty response header name, aborting request
...
Run Code Online (Sandbox Code Playgroud)
此外,这不是SSL/Apache的错误配置,因为其他子域上的其他应用程序继续正常工作,无论是否使用Let的加密SSL证书.
谷歌没有帮助,除了一些德国讨论建议使用PHP 5.3:https: //www.php.de/forum/webentwicklung/php-frameworks/1508593-installation-symfony-framework
Symfony 1 geht nur mit maximal PHP 5.3 ... Deswegen sagte ich doch hol dir Symfony 3 !!!
我清理了几次缓存.我删除了所有Let的加密SSL配置以及恢复旧的自签名SSL证书并将Apache配置恢复到之前的工作状态.
而且因为我们每天都进行备份,所以我甚至还在几个小时前恢复了整个代码备份.
这应该肯定有效.
我仍然得到相同的错误,没有关于如何调试它的线索/提示.Symfony日志记录文档适用于其当前版本,而不适用于1.4
什么可能导致这个问题?
如何启用调试以便我可以找到创建错误"空响应头名称"的位置,以便我可以修补它?
小智 10
我修改了函数它的工作原理:(php 7.0+)
第407行的.../core/lib/vendor/symfony/lib/response/sfWebResponse.class.php
/**
* Retrieves a normalized Header.
*
* @param string $name Header name
*
* @return string Normalized header
*/
protected function normalizeHeaderName($name)
{
$out = [];
array_map(function($record) use (&$out) {
$out[] = ucfirst(strtolower($record));
}, explode('-',$name));
return implode('-',$out);
}
小智 0
我能够将问题追溯到发送的标头
core/lib/vendor/symfony/lib/response/sfWebResponse.class.php
on line 357
Run Code Online (Sandbox Code Playgroud)
价值观出了问题。
qdPM 9.0 在 PHP7 上正常运行了一年多,直到 Ubuntu 16.04 的 Apache 2 更新出现。
然而我发现了一个问题:
E_WARNING: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in
.../core/lib/vendor/symfony/lib/response/sfWebResponse.class.php on line 409
Run Code Online (Sandbox Code Playgroud)
但我不明白旧行:
return preg_replace('/\-(.)/e', "'-'.strtoupper('\\1')", strtr(ucfirst(strtolower($name)), '_', '-'));
Run Code Online (Sandbox Code Playgroud)
转换以便它可以工作。据我了解,它将用大写字母替换破折号后面的任何内容。但我无法让它工作preg_replace_callback:
return preg_replace_callback('\-(.)', function($m) { return '-'.strtoupper($m[1]); } , strtr(ucfirst(strtolower($name)), '_', '-'));
Run Code Online (Sandbox Code Playgroud)
匿名函数根本不会被调用。我已经完全删除了预浸料替换件,现在它工作正常。也许我们会在这里得到如何正确解决它的更新。