Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

qdPM Symfony 1.4 500 Internal server error - Empty response header name, aborting request

I have been using qdPM v9.0 (from qdpm/core/apps/qdPM/config/app.yml) on Centos 6.7 server with PHP 7.0.6 and apache 2.2.x and MariaDB 5.5.x for over a year now without any issues. It seems to be using legacy Symfony 1.4.

I tried to install Let's Encrypt SSL certificates and this upgraded Apache/httpd to 2.2.15, no change in PHP or MariaDB versions.

Upon restarting httpd after SSL certificate installation, suddenly I get 500 Internal Server Error and the httpd error log shows:

...
[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
...

Also, this is not a misconfiguration of SSL/Apache because other apps on other sub-domains continue work fine, both with and without Let's Encrypt SSL certificates.

Google does not help except some German discussion suggests to use 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!!!

I cleared the cache several times. I removed all Let's Encrypt SSL configuration as well as restored old self-signed SSL certificates and restored Apache configuration to earlier working state.

And because we take backups daily, I even restored the entire code backup from a few hours before.

This should definitely have worked.

I still get the same error and no clue / hint as to how to debug it. Symfony logging documentation is for its current version, not for 1.4

What could have caused this issue?

How do I enable debugging so I could find where the error "Empty response header name" is being created so that maybe I can patch it?

like image 436
site80443 Avatar asked Aug 09 '17 16:08

site80443


2 Answers

I modified the function and it works: (php 7.0+)

.../core/lib/vendor/symfony/lib/response/sfWebResponse.class.php on line 407

/** * 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); }

like image 57
Gábor Molnár Avatar answered Oct 05 '22 22:10

Gábor Molnár


This version works fine too:

  /**
   * Retrieves a normalized Header.
   *
   * @param  string $name  Header name
   *
   * @return string Normalized header
   */
  protected function normalizeHeaderName($name)
  {
    return preg_replace_callback('/\-(.)/', function ($matches) { return '-'.strtoupper($matches[1]); }, strtr(ucfirst(strtolower($name)), '_', '-'));
  }
like image 20
Lionel Avatar answered Oct 05 '22 23:10

Lionel