Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.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
Php SwiftMailer错误未定义属性:Swift\u Transport\u StreamBuffer::$\u序列_Php_Swiftmailer_Php 5.5 - Fatal编程技术网

Php SwiftMailer错误未定义属性:Swift\u Transport\u StreamBuffer::$\u序列

Php SwiftMailer错误未定义属性:Swift\u Transport\u StreamBuffer::$\u序列,php,swiftmailer,php-5.5,Php,Swiftmailer,Php 5.5,我正在使用SwiftMailer通过SMTP发送电子邮件。该库在PHP版本5.4的服务器上运行时工作正常。但是,将服务器升级到PHP 5.5版后,未发送电子邮件,服务器抛出以下错误: Undefined property: Swift_Transport_StreamBuffer::$_sequence 我如何解决这个问题?谢谢。我已通过执行以下操作解决了此问题: 打开lib/classes/Swift/Transport/StreamBuffer.php 在类中添加private$\u se

我正在使用SwiftMailer通过SMTP发送电子邮件。该库在PHP版本5.4的服务器上运行时工作正常。但是,将服务器升级到PHP 5.5版后,未发送电子邮件,服务器抛出以下错误:

Undefined property: Swift_Transport_StreamBuffer::$_sequence

我如何解决这个问题?谢谢。

我已通过执行以下操作解决了此问题:

打开lib/classes/Swift/Transport/StreamBuffer.php

在类中添加private$\u sequence,如下所示:

class Swift_Transport_StreamBuffer extends Swift_ByteStream_AbstractFilterableInputStream implements Swift_Transport_IoBuffer
{
    private $_sequence; /** added to fix the undefined property error **/

    /** A primary socket */
    private $_stream;

    /** The input stream */
    private $_in;
...

swift-mailer/classes/swift/ByteStream/AbstractFilterableInputStream.php
change

 private $_sequence = 0;

然后信息就消失了


我必须在遗留项目中使用与您不同的Swiftmailer版本我收到了完全相同的错误通知。我的
Swift::VERSION
4.1.1

必须在以下两个文件中进行更改:

  • swift-mailer/classes/swift/ByteStream/AbstractFilterableInputStream.php
  • lib/classes/Swift/Transport/StreamBuffer.php
只换了一个,我就得到了这个:

PHP致命错误:对的访问级别 Swift\u传输\u流缓冲区::$\必须保护序列(如中所示 类Swift_ByTestStream_AbstractFilterableInputStream)或更弱 /打开opt/viptel/recorder/lib/classes/Swift/Transport/StreamBuffer.php 第20行


也请说,哪个版本的Swiftmailer是相关的。另外,请检查是否存在错误报告,如果没有,请创建错误报告。然后将其与您的答案一起参考。问题已于2013年8月报告,因此无需报告。如果您使用的是过时的Swiftmailer库,则无需提供修补程序。这是关于哪个版本的?正如您在评论中看到的,在较新版本的Swiftmailer中,变量的更改方式与hakre在此处描述的完全相同:
 protected $_sequence = 0;