php错误:$expiration must be an object implementing the DateTimeInterface

348

phpDateTimeInterface的错误:

PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with message '$expiration must be an object implementing the DateTimeInterface' in /xxx/phpFastCache/phpFastCache/Cache/ItemBaseTrait.php:134\nStack trace:\n#0 /xxx/phpFastCache/phpFastCache/Core/StandardPsr6StructureTrait.php(64): phpFastCache\\Drivers\\Files\\Item->expiresAt(Object(DateTime))\n#1 /xxx/index.php(100): phpFastCache\\Core\\DriverAbstract->getItem('6666cd76f969564...')\n#2 {main}\n  thrown in /xxx/phpFastCache/phpFastCache/Cache/ItemBaseTrait.php on line 134

错误原因

DateTimeInterface对php版本要求5.5+ (PHP 5 >= 5.5.0, PHP 7),参考官方 http://php.net/manual/en/class.datetimeinterface.php

解决方法

升级PHP至5.5+,参考

Post Comment