2

I have spotted some dependency issue working with PHP 5.5.9-1ubuntu4.5.

Trying to parse some HTTP headers but ended with:

__ [Symfony\Component\Debug\Exception\UndefinedFunctionException] Attempted to call function "http_parse_headers"__

I've solved it by installing pecl_http extension but most important was to put:

extension=json.so

above

extension=http.so

More info here: https://bugs.php.net/bug.php?id=67140

but when I'm trying:

php -r 'echo defined("http_parse_headers") ? "yes" : "no";'

I gets 'no' :/

http extension is on libs list printed by php -m

I have installed via:

pecl install pecl_http

php -r 'echo phpversion("http");'

gives me 2.1.4 strange...

Any advice please

Codium
  • 3,200
  • 6
  • 34
  • 60

1 Answers1

0

You have to use a new syntax

\http\Header::parse($yourHeaders);

see https://stackoverflow.com/a/34792452/288568

Community
  • 1
  • 1
Alex
  • 32,506
  • 16
  • 106
  • 171