2014-07-08 15 views
1

我試圖使用AWS S3在我的Zend框架內建2AWS-SDK-PHP + Zend框架2骨架=>信號分割故障(11)

一些真正奇怪的事情發生了,把我最近的一個項目幾小時谷歌搜索,但仍然無法找到解決方案,所以我在這裏尋求幫助。

我開始了一個新的Zend Framework 2 Skeleton應用程序,並通過作曲者安裝aws/aws-sdk-php

一個簡單的S3 :: putObject請求被創建:當我PHPUnit中測試它

$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 
      )); 

上面的代碼工作正常。但是,當我打開瀏覽器查看來自同一個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後,我設法確定了Guzzle\Http\Curl\CurlMulti中的問題,似乎在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 

任何幫助或急需的建議!

+0

我在AWS linux服務器上遇到了同樣的問題。 –

回答

0

我花了幾個小時追查同樣的問題,當它發生OpenSSL的支持不內置用於構建curl擴展版本的libcurl的:

build.log

checking for openssl support in libcurl... no 

你就需要使用OpenSSL的支持,例如安裝捲曲使用brew:brew install curl --with-openssl(可能不需要--with-openssl)。

一旦openssl支持libcurl可用,您需要將選項--with-curl添加到您的生成命令,對我來說這是phpbrew .. --with-curl=/usr/local/opt/curl