cakephp发送post请求

来源:互联网 发布:js单例和实际化 编辑:程序博客网 时间:2024/06/09 20:39
    if ($this->config['persistent'] == true) {
            $tmp = null;
            $this->connection = @pfsockopen($scheme.$this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
        } else {
            $this->connection = @fsockopen($scheme.$this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);

        }

发现 $this->connection总是返回false,原来是因为没有打开openssl

解决方案:windows下,在php.ini中打开opensll扩展,并将php目录下的libeay32.dll和ssleay32.dll两个库拷贝到system32下

linux下,重新编译php,编译时加上参数--enable-ssl(具体参看configure的help)

0 0
原创粉丝点击