mondodb 插入中文 Uncaught MongoDB\Driver\Exception\UnexpectedValueException: Detected invalid UTF-8 for field path

25 11月

mondodb 插入中文 Uncaught MongoDB\Driver\Exception\UnexpectedValueException: Detected invalid UTF-8 for field path

[25-Nov-2021 11:24:05 Asia/Shanghai] PHP Fatal error:  Uncaught MongoDB\Driver\Exception\UnexpectedValueException: Detected invalid UTF-8 for field path "name": 菜鸟教程 in /data/wwwroot/default/test7.php:22
Stack trace:
#0 /data/wwwroot/default/test7.php(22): MongoDB\Driver\BulkWrite->insert()
#1 {main}
  thrown in /data/wwwroot/default/test7.php on line 22

文件类型问题,把文件编码用notpad++改成utf8覆盖服务器端即可

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注