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

4
  • stackoverflow.com/questions/25596949/… different php.ini for cli? Commented Jan 16, 2015 at 16:35
  • @Steve so why php -m return me http on list? Commented Jan 16, 2015 at 16:41
  • php.net/manual/pl/function.function-exists.php return false too... Commented Jan 19, 2015 at 10:52
  • Similar problem here... using ondrej's PHP PPA - echo phpversion('http'); 2.5.6 Commented Aug 9, 2016 at 12:04

1 Answer 1

0

You have to use a new syntax

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

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.