www.webdeveloper.com
Results 1 to 4 of 4

Thread: Fatal error: Class 'HttpResponse' not found even after pecl_http loaded in php.ini

  1. #1
    Join Date
    Mar 2014
    Posts
    2

    Post Fatal error: Class 'HttpResponse' not found even after pecl_http loaded in php.ini

    I have installed and loaded PECL http extension.

    I have added these lines in php.ini:

    extension=raphf.so
    extension=propro.so
    extension=http.so

    And I see the following being added in the output of

    phpinfo()
    HTTP Support enabled, Extension Version 2.0.4

    libz 1.2.5 1.2.5

    libcurl 7.24.0 7.24.0

    libevent disabled disabled

    But when I try to use the class HttpResponse I am getting the error:

    Fatal error: Class 'HttpResponse' not found in RequestHandler.php on line 21

    Can anyone please guide to what I have missed.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,334
    I think it may be a case of HttpRequest being only in PECL HTTP v1, but not in v2 (which is what you have installed)? At least I don't see it mentioned in the V2 documentation, but the documentation on php.net appears to be for V1.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Mar 2014
    Posts
    2
    Thanks for looking into it NogDog.

    I also tries using pecl_pecl methods like http_send_status(), http_send_content_type(), and http_send_data() but keep getting the error:

    PHP Fatal error: Call to undefined function http_send_status()

    I have ensured that the http.so and related dependencies are in the correct folder and executable and are loaded in php.ini

    I am at my wits end and I have a feeling that I am missing something very obvious.

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,334
    I might try installing a 1.x version of PECL_HTTP and see if that cleans up your issues.

    PS: Actually, I'd probably just use the cURL extension, instead -- but that's mainly because it's what I'm used to.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles