PHP Fatal error: Interface 'JsonSerializable' not found - My Php Version is 7.0.17
PHP Fatal error: Interface 'JsonSerializable' not found - My Php Version is 7.0.17
我开发了一个 Laravel 项目。在本地系统中它工作正常。当我将项目移动到服务器时。它的 Return 跟随误差。
PHP Fatal error: Interface 'JsonSerializable' not found in /home/vendor/laravel/framework/src/Illuminate/Support/Collection.php on line 18
我的 PHP 版本是 7.0.17。如何解决此问题。
Collection.php
use Countable;
use Exception;
use ArrayAccess;
use Traversable;
use ArrayIterator;
use CachingIterator;
use JsonSerializable;
use IteratorAggregate;
use InvalidArgumentException;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Contracts\Support\Arrayable;
class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable
{
use Macroable;
.....................
......................
}
看来本地和服务器之间的设置不同。
确保您引用的资源可用于与本地相同位置的服务器。
检查您的 Php 信息设置,Json 已启用。
我开发了一个 Laravel 项目。在本地系统中它工作正常。当我将项目移动到服务器时。它的 Return 跟随误差。
PHP Fatal error: Interface 'JsonSerializable' not found in /home/vendor/laravel/framework/src/Illuminate/Support/Collection.php on line 18
我的 PHP 版本是 7.0.17。如何解决此问题。
Collection.php
use Countable;
use Exception;
use ArrayAccess;
use Traversable;
use ArrayIterator;
use CachingIterator;
use JsonSerializable;
use IteratorAggregate;
use InvalidArgumentException;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Contracts\Support\Arrayable;
class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable
{
use Macroable;
.....................
......................
}
看来本地和服务器之间的设置不同。
确保您引用的资源可用于与本地相同位置的服务器。
检查您的 Php 信息设置,Json 已启用。