php request error,“PHP Fatal error: Class 'HttpRequest' not found”

I've been stuck trying to solve this problem in many ways, reading a lot of posts but still having no luck. I work on a Mac, OSX 10.7 Lion, and I'm writing a plugin for a WordPress site (php files) using MAMP, and at one point I have to make an HTTP request: $request = new HttpRequest('something'); $request->setMethod(HTTP_METH_GET);

There's an error when executing this request and when I checked the log file, here's the message: "PHP Fatal error: Class 'HttpRequest' not found in (the_php_file)"

I've already installed PEAR, PECL and the HTTP extension (pecl_http), Xcode and its command line tools. This is what I did: modified the PATH: $ echo "export PATH=/Applications/MAMP/bin/php/php5.5.3/bin:$PATH" >> ~/.profile`

verified that the paths for php, pear and pecl are correct: /Applications/MAMP/bin/php/php5.3.6/bin/php is the path for php

/Applications/MAMP/bin/php/php5.3.6/bin/pear for pear

/Applications/MAMP/bin/php/php5.3.6/bin/pecl for pecl

I downloaded the source for php from the MAMP page (and checked that the version I downloaded was the same one I'm using, which is php5.5.3). Then I extracted the content and put it into /Applications/MAMP/bin/php/php5.5.3/include/php

Inside /Applications/MAMP/bin/php/php5.5.3/include/php I ran ./configure

I executed: pecl install pecl_http

I also added these extensions to the php.ini (initially, I modified the MAMP/bin/php/php5.5.3/conf/php.ini file): extension=raphf.so extension=propro.so extension="http.so"

About that last one in quotation marks: when I added the extension manually, I did it like this: extension=http.so. Then (when trying to fix my problem) I tried an alternative installation that modified the php.ini automatically, and wrote the extension with the quot. marks, but the result was still the same, so it didn't make a difference.

After all of this, I stopped the MAMP server and started it again, but when I executed the php I still got the error (visible in the php_error.log): PHP Fatal error: Class 'HttpRequest' not found

I'd appreciate any idea because I've run out of them.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值