0

I am running php 5.4.17 on OS X 10.9.1. I have installed pear using this command:

wget http://pear.php.net/go-pear.phar
php -d detect_unicode=0 go-pear.phar

Then I have installed pecl_http with:

pecl install pecl_http

I have added extension lines to my php.ini and add 'x' permission to library binaries. If I run php -i I get:

http

HTTP Support => enabled
Extension Version => 2.0.4

Used Library => Compiled => Linked
libz => 1.2.5 => 1.2.5
libcurl => 7.30.0 => 7.30.0
libevent => disabled => disabled

Directive => Local Value => Master Value
http.etag.mode => crc32b => crc32b

But if I try to run php script with HttpRequest inside I still get:

Fatal error: Class 'HttpRequest' not found

Can somebody give me a clue what am I doing wrong?

jnnv
  • 68
  • 8

1 Answers1

0

You are using pecl_http 2.0.4 and probably refer to documentation from http://www.php.net/manual/en/class.httprequest.php which is for older version. There is a post that's already explained your problem: PECL_HTTP not recognised php ubuntu

In fact, you should refer to the documentation defined here: http://devel-m6w6.rhcloud.com/mdref/http

To verify: if (class_exists('http\Client\Request')) printf 'pecl_http v2 is installed'

Community
  • 1
  • 1
Nam Pham
  • 136
  • 2
  • 9