PHP 警告:PHP 启动:无法加载动态库
'/usr/lib/php/20151012/mongodb.so' - /usr/lib/php/20151012/mongodb.so:
未定义符号:第 0 行未知中的 php_json_serialized_ce
安装 MongoDB 后,每当我从终端运行任何 php 命令时,我都会收到此错误:
PHP工匠
php -v
我已经找了2天了。我见过这些:
PHP无法加载动态库(mongo.so) https://stackoverflow.com/questions/24030255/php-unable-to-load-dynamic-library-mongo-so
https://github.com/mongodb/mongo-php-library/issues/126 https://github.com/mongodb/mongo-php-library/issues/126
我很确定谷歌会出现此错误的任何其他解决方案。它们似乎都是 php5 的修复程序,但对我不起作用。
我已将extension=mongodb.so 添加到ini 文件中。
我已经销毁了虚拟机并重新启动了 100 次。
我在跑:
流浪者1.8.5
Laravel 安装程序版本 1.3.3
vagrant@homestead:~$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mongodb.so' - /usr/lib/php/20151012/mongodb.so: undefined symbol: php_json_serializable_ce in Unknown on line 0 PHP
7.0.13-1+deb.sury.org~xenial+1 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.13-1+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies
with blackfire v1.14.1~linux-x64-non_zts70, https://blackfire.io, by Blackfireio Inc.
Mongo 已安装并运行良好:
vagrant@homestead:~$ mongo
MongoDB shell version v3.4.0
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.0
Server has startup warnings:
2016-12-05T15:32:01.158+0000 I STORAGE [initandlisten]
2016-12-05T15:32:01.204+0000 I CONTROL [initandlisten]
2016-12-05T15:32:01.204+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2016-12-05T15:32:01.204+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2016-12-05T15:32:01.204+0000 I CONTROL [initandlisten]
2016-12-05T15:32:01.204+0000 I CONTROL [initandlisten]
2016-12-05T15:32:01.204+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-12-05T15:32:01.204+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2016-12-05T15:32:01.204+0000 I CONTROL [initandlisten]
2016-12-05T15:32:01.204+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-12-05T15:32:01.205+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2016-12-05T15:32:01.205+0000 I CONTROL [initandlisten]
>
但我无法无缘无故地阻止这个 php 错误!!!