Apache/PHP: "function not defined" even after properly loading extension

Posted on 2014-08-05
Last Modified: 2014-08-05
I have a piece of vendor php code that requires the http_parse_message() function.
I look up the function and it is part of the PECL HTTP extension:
So I install PECL and its dependencies, as well as the HTTP extension and its dependencies.

I am loading http as well as extensions listed as dependencies (have tried in php.ini, as well as a custom php.d/zhttp.ini):
extension =
(I named it zhttp.ini so it is loaded after json.ini or I will get a json function error when tries to load)
I also have tried inserting configuration info in the zhttp.ini I created:

I have the pecl HTTP extension loaded and displaying the proper version using phpinfo:
HTTP Support      enabled
Extension Version      2.0.7
Used Library      Compiled      Linked
libz      1.2.3      1.2.3
libcurl      7.19.7      7.19.7
libevent      disabled      disabled
Directive      Local Value      Master Value
http.etag.mode      crc32b      crc32b
But the page is still broken and this is in the error log:
cat /var/log/httpd/error_log
[Sun Aug 03 20:45:26 2014] [client 171.71.x.71] PHP Fatal error:  Call to undefined function http_parse_message() in /var/www/web-portal/includes/txx_trusted.php on line 35
I do not think this is an apache issue because I get the same error if I try to run a php script containing it from the prompt.

So if the extension shows loaded and the proper version why is the function still missing from php?
Question by:mmgibso29
    1 Comment

    Accepted Solution

    Looks like the PECL HTTP 2.x is completely incompatible with the 1.x functions.  I downgraded to the latest in the 1.x code tree and fixed the issue

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now