亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

出現錯誤“PHP 消息:PHP 致命錯誤:未捕獲錯誤:

出現錯誤“PHP 消息:PHP 致命錯誤:未捕獲錯誤:

PHP
神不在的星期二 2023-04-15 20:22:03
我已經在我的服務器上安裝了 MongoDB,我正在嘗試運行這個腳本:<?php$client = new MongoClient();$collection = $client->cryptnote->storedMessages;function insertDocument($collection, $id, $telegramuser, $message) {    $doc = array(        "id" => $id,        "telegram" => $telegramuser,        "encrypted" => $message,    );    try {        $collection->insert($doc);    } catch(Exception $e) {        echo "Error" . $e;    }}function findDocument($collection, $id){    return $collection->findOne(["id" => $id]);}insertDocument($collection, "test123", "usertest", "message. test.");$query = findDocument($collection, "test123");echo "<pre>";var_dump($query);這是我得到的錯誤: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Class 'MongoClient' not found in /var/www/html/dbtest.php:5我的 Apache 服務器使用/etc/php/7.3/fpm/php.ini根據phpinfo();.添加extension=mongodb.so到php.ini文件是沒有用的。
查看完整描述

1 回答

?
倚天杖

TA貢獻1828條經驗 獲得超3個贊

解決方案是重新啟動php-fpm。

在我的例子中,我安裝了 PHP 7.3 版,所以我需要運行這個命令: sudo service php7.3-fpm restart


查看完整回答
反對 回復 2023-04-15
  • 1 回答
  • 0 關注
  • 153 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號