laravel PHP 致命错误:找不到接口“JsonSerializable” - 我的 PHP 版本是 7.0.17
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43363108/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PHP Fatal error: Interface 'JsonSerializable' not found - My Php Version is 7.0.17
提问by Karthikvijayaveni
I Developed One Laravel Project. In local System Its working Fine. When i move the Project to the Server. Its Return Following Error.
我开发了一个 Laravel 项目。在本地系统中它工作正常。当我将项目移动到服务器时。它的返回跟随错误。
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.
我的 PHP 版本是 7.0.17。如何解决此问题。
Collection.php
集合.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;
.....................
......................
}
回答by Karthik
Check your Php info Settings, Json is Enabled.
检查您的 PHP 信息设置,Json 已启用。
回答by Stese
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.
确保您引用的资源可用于与本地位于同一位置的服务器。