?
Solved

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

Posted on 2014-08-05
1
Medium Priority
?
838 Views
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:
http://php.net/manual/en/function.http-parse-message.php
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=raphf.so
extension=propro.so
extension = http.so
(I named it zhttp.ini so it is loaded after json.ini or I will get a json function error when http.so tries to load)
I also have tried inserting configuration info in the zhttp.ini I created:
http.etag.mode=MD5
;http.log.cache=
;http.log.redirect=
;http.log.not_found=
;http.log.allowed_methods=
;http.log.composite=
;http.request.methods.allowed=
;http.request.methods.custom=
http.request.datashare.cookie=0
http.request.datashare.dns=1
http.request.datashare.ssl=0
http.request.datashare.connect=0
http.persistent.handles.limit=-1
http.persistent.handles.ident=GLOBAL
http.send.inflate.start_auto=0
http.send.inflate.start_flags=0
http.send.deflate.start_auto=0
http.send.deflate.start_flags=0
http.send.not_found_404=1
http.only_exceptions=0
http.force_exit=1

I have the pecl HTTP extension loaded and displaying the proper version using phpinfo:
http
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?
0
Comment
Question by:mmgibso29
1 Comment
 

Accepted Solution

by:
mmgibso29 earned 0 total points
ID: 40242028
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
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month17 days, 3 hours left to enroll

862 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