PHP 致命错误:未找到接口“JsonSerialized”

2024-03-10

我今天已将我的 D8 站点从 Windows 迁移并配置到 Ubuntu 14.04 PC。但是当我运行该网站时,我收到以下错误:

致命错误:在第 32 行 /var/www/eCartZone/core/lib/Drupal/Component/Render/MarkupInterface.php 中找不到接口“JsonSerialized”

我检查了已安装的模块php -m从终端,我在列表中找到了它。

我使用安装了 PHP 5.5.33$ phpbrew install php-5.5.33 +default+json+mysql+curl

版本信息:

Php: 5.5.33
Drupal: 8.2.3
Apache: 2.4.7
MySql: 14.14, Distrib 5.5.53

我不知道如何解决这个问题!有人请帮我解决问题。

UPDATE
命令输出php -r "phpinfo();" | grep json

PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Command line code on line 1
Configure Command =>  './configure'  '--cache-file='''/home/subrara/.phpbrew/cache/config.cache'''' '--prefix=/home/subrara/.phpbrew/php/php-5.5.33' '--with-config-file-path=/home/subrara/.phpbrew/php/php-5.5.33/etc' '--with-config-file-scan-dir=/home/subrara/.phpbrew/php/php-5.5.33/var/db' '--disable-all' '--enable-session' '--enable-short-tags' '--with-zlib=/usr' '--with-libdir=lib/x86_64-linux-gnu' '--with-curl=/usr' '--enable-json' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--enable-libxml' '--enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--with-libxml-dir=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--enable-cli' '--enable-ctype' '--enable-dom' '--enable-fileinfo' '--enable-filter' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-mbregex' '--enable-mbstring' '--with-mhash=/usr' '--with-mcrypt=/usr' '--enable-pcntl' '--with-pcre-regex' '--with-pcre-dir=/usr' '--enable-pdo' '--enable-phar' '--enable-posix' '--with-readline=/usr' '--enable-sockets' '--enable-tokenizer' '--with-openssl=/usr' '--enable-zip' '--with-pear=/home/subrara/.phpbrew/php/php-5.5.33/lib/php' '--enable-zend-signals'
/home/subrara/.phpbrew/php/php-5.5.33/var/db/json.ini
json
json support => enabled
json version => 1.2.1

您需要在系统上安装 php-json。在基于 redhat 的操作系统上,您可以使用以下命令安装它:

sudo dnf install php-json

在基于 Debian 的操作系统上,执行以下操作:

sudo apt-get install php-json
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

PHP 致命错误:未找到接口“JsonSerialized” 的相关文章

随机推荐