PHP Fatal error: Interface 'JsonSerializable' not found - My Php Version is 7.0.17 [closed]

瘦欲@ 提交于 2019-12-02 17:23:31

问题


I Developed One Laravel Project. In local System Its working Fine. When i move the Project to the Server. Its Return Following Error.

PHP Fatal error:  Interface 'JsonSerializable' not found in /home/vendor/laravel/framework/src/Illuminate/Support/Collection.php on line 18

My PHP Version is 7.0.17. How to Fix this Issue.

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;
    .....................
    ......................
}

回答1:


Check your Php info Settings, Json is Enabled.




回答2:


It would appear that the setup between local and server is different.

Ensure that the resources you are referencing are available to the server in the same location as the local.



来源:https://stackoverflow.com/questions/43363108/php-fatal-error-interface-jsonserializable-not-found-my-php-version-is-7-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!