【问题标题】:Laravel SSL read operation timed out | Swift_IoException | PHP bug?Laravel SSL 读取操作超时 | Swift_IoException | PHP错误?
【发布时间】:2014-10-06 10:25:33
【问题描述】:

我在 Laravel 4 中有一个错误:

ErrorException (E_UNKNOWN) fgets(): SSL 读取操作超时

156.     * @return string
157.     *
158.     * @throws Swift_IoException
159.     */
160.    public function readLine($sequence)
161.    {
162.        if (isset($this->_out) && !feof($this->_out)) {
163.            $line = fgets($this->_out);
164.            if (strlen($line) == 0) {
165.                $metas = stream_get_meta_data($this->_out);

此错误与 SendGrid 有关。我的 Laravel 设置是默认的:

laravel>app>config>mail.php

<?php

array(
  'driver' => 'smtp',
  'port' => 465,        
  'encryption' => 'ssl',
  'sendmail' => '/usr/sbin/sendmail -bs',
)

如何解决?

(另见:Laravel.io

【问题讨论】:

    标签: php email ssl laravel swiftmailer


    【解决方案1】:

    解决方案 1

    我找到了解决方案,但这不是最好的方法。为了测试它是好的:)

    当我将我的应用程序上传到云端时,我收到了错误消息。 在域上,我关闭了 SSL。在laravel&gt;app&gt;config&gt;mail.php,我改变了这个:

    <?php
    
    array(
      'driver' => 'smtp',
      'port' => 25, //earlier: 465     
      'encryption' => '', //earlier: 'ssl'
      //other settings
    )
    

    解决方案 2

    可能是 PHP 5.4.33 / 5.5.17 (link) 中的这个错误。您必须降级到版本 5.4.32。那么它应该可以工作。

    yum downgrade $(rpm -qa --qf "%{NAME}\n" | grep ^php | awk '{print $1"-5.4.32"}') -y
    

    另见laravel.io


    解决方案 3

    解决方案3真的很简单,关闭域上的所有SSL。

    【讨论】:

      【解决方案2】:

      既然有更新可用,另一种解决方案是将 PHP 升级到 v5.5.18:

      sudo apt-get update
      sudo apt-get dist-upgrade
      

      希望这会有所帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-08-07
        • 1970-01-01
        • 2012-02-25
        • 2021-02-16
        • 1970-01-01
        • 2018-08-04
        • 2016-10-21
        相关资源
        最近更新 更多