Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
aws sdk php+zend framework 2 skeleton=>信号分段故障(11)_Php_Curl_Amazon Web Services_Amazon S3_Zend Framework2 - Fatal编程技术网

aws sdk php+zend framework 2 skeleton=>信号分段故障(11)

aws sdk php+zend framework 2 skeleton=>信号分段故障(11),php,curl,amazon-web-services,amazon-s3,zend-framework2,Php,Curl,Amazon Web Services,Amazon S3,Zend Framework2,我在最近基于Zend Framework 2构建的项目中尝试使用AWS S3 发生了一些非常奇怪的事情,我花了几个小时在谷歌上搜索,但仍然找不到解决办法,所以我在这里寻求帮助 我启动了一个全新的Zend Framework 2框架应用程序,并通过composer安装 创建了一个简单的S3::putObject请求: $client = S3Client::factory(array( 'key' => 'xxx', 'secret' => 'xxx',

我在最近基于Zend Framework 2构建的项目中尝试使用AWS S3

发生了一些非常奇怪的事情,我花了几个小时在谷歌上搜索,但仍然找不到解决办法,所以我在这里寻求帮助

我启动了一个全新的Zend Framework 2框架应用程序,并通过composer安装

创建了一个简单的S3::putObject请求:

$client = S3Client::factory(array(
        'key' => 'xxx',
        'secret' => 'xxx',
        'region' => 'xxx',
    ));

$client->putObject(array(
                'Bucket' => $bucket,
                'Key' => '/test/test.html',
                'Body' => 'This is a test' . time(),
                'ContentType' => 'text/html',
                'Acl' => CannedAcl::PUBLIC_READ
            ));
当我在PHPUnit中测试时,上面的代码运行良好。然而,当我打开浏览器查看来自同一IndexController的结果时,Firefox只是报告“连接已重置”。PHP不会抛出任何异常

我打开了Apache的错误日志,看到:

[Tue Jul 08 04:58:58 2014] [notice] child pid 33428 exit signal Segmentation fault (11)
[Tue Jul 08 04:59:15 2014] [notice] child pid 33439 exit signal Segmentation fault (11)
[Tue Jul 08 04:59:16 2014] [notice] child pid 33361 exit signal Segmentation fault (11)
[Tue Jul 08 05:02:02 2014] [notice] child pid 33452 exit signal Segmentation fault (11)
[Tue Jul 08 05:02:50 2014] [notice] child pid 33142 exit signal Segmentation fault (11)
[Tue Jul 08 05:04:34 2014] [notice] child pid 33317 exit signal Segmentation fault (11)
[Tue Jul 08 05:04:35 2014] [notice] child pid 33143 exit signal Segmentation fault (11)
[Tue Jul 08 05:06:18 2014] [notice] child pid 33522 exit signal Segmentation fault (11)
[Tue Jul 08 05:06:19 2014] [notice] child pid 33534 exit signal Segmentation fault (11)
我在谷歌上搜索了错误,找到了这个问题的不同答案,但似乎没有一个适用于我

在尝试了最新的Zend Server 7之后,我设法解决了中的问题,似乎在curl_multi_*操作期间发生了一些事情。我认为问题应该是PHP在无限循环中,但是为什么它在PHPUnit下工作得很好呢?这与从CLI运行无关,因为我只是尝试了相同的URL并得到:

curl: (52) Empty reply from server
所以看起来问题仍然来自代码内部

谷歌的一些帖子指出这个curl问题可能是因为OSX Maverick的openssl问题,但我认为我没有这个问题,因为我的curl可以很好地处理任何https请求

我对这个问题的研究到此为止:

aws sdk php已经推出了相当长的一段时间,我不认为这是lib的错误,它可能是我的机器吗?这是我的软件环境

OSX Mavericks 10.9.4
Zend Server 7 with PHP 5.5.13
curl --version
curl 7.30.0 (x86_64-apple-darwin13.0) libcurl/7.30.0 SecureTransport zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM NTLM_WB SSL libz

急需任何帮助或建议

我花了数小时来跟踪相同的问题,当openssl支持没有内置到用于构建curl扩展的libcurl版本中时,就会发生这种情况:

build.log

您需要使用openssl支持安装curl,例如使用brew:brew安装curl-使用openssl-可能不需要使用openssl


一旦一个支持openssl的libcurl可用,您就需要在build命令中添加-with curl选项,对我来说这是phpbrew-使用curl=/usr/local/opt/curl。

我在AWS linux服务器上也遇到了同样的问题。
checking for openssl support in libcurl... no