PHP HTTP-Request
问题 I have MAMP Pro installed running php 5.2.13. When I try to initialize a HTTP-Request $r = new HttpRequest('http://example.com/', HttpRequest::METH_GET); it tells me: "Class 'HttpRequest' not found in ...". What do I need to do to 'install(?)' it? 回答1: You must enable http extension: http://www.php.net/manual/en/http.setup.php Or you can try new HTTP_Request2: sudo pear install --alldeps HTTP_Request2-alpha And then: $req = new HTTP_Request2('your.url'); $req->setMethod('POST'); $req-