我正在嘗試使用SSLL做一個cakephp shell使用httpsocket和ssl。Cakephp httpsocket ssl不能與控制檯shell一起工作
我的「稻草人」殼:
App::uses('HttpSocket', 'Network/Http');
class UpdaterShell extends AppShell {
public function main() {
// STRAWMAN
$httpSocket = new HttpSocket();
$results = $httpSocket->post(
'https://accounts.google.com/o/oauth2/token',
'foo=bar'
);
debug($results);
}
}
現在,我不希望從谷歌的成功響應,因爲在這種簡單的測試,我還沒有提供必要的PARAMS。
但我做什麼得到的是:[email protected] unable to find the socket transport "ssl" - did you forget to enable it when you configured php?
我沒有,OpenSSL是啓用的,爲了證明這一點,這個工程:
App::uses('AppController', 'Controller');
App::uses('HttpSocket', 'Network/Http');
class StrawmanController extends AppController {
public function index() {
// STRAWMAN
$httpSocket = new HttpSocket();
$results = $httpSocket->post(
'https://accounts.google.com/o/oauth2/token',
'foo=bar'
);
debug($results);
}
}
(和作品,我的意思是響應與「invalid_request」。)
總結:當我通過控制器或模型,而不是通過控制檯使用它openssl的作品。
有誰知道爲什麼,以及如何讓它工作?
謝謝! A
PS:既很好地工作正常稱職的http:// – 2013-03-19 11:28:50