MongoDB PHP驱动程序无法正常工作

我正在使用Mac OSX 10+,我在我的系统中使用Xampp。 我需要安装PHP Mongodb驱动程序将它连接到我的应用程序的mongodb但是它不能正常工作,我尝试了以下步骤:</ p>


  1. 使用
    <代码安装Mongodb驱动程序 > sudo / Applications / XAMPP / xamppfiles / bin / pecl install mongo </ code> </ li>
  2. extension =“mongo.so”添加到php.ini / Applications / XAMPP / xamppfiles / etc </ code> </ li>
    </ ol>

    但在此之后它不会让Apache Server启动; 如果我从 php.ini </ code>中删除 extension =“mongo.so”</ code>,那么它就可以重新开始了</ p>

    方法2:</ p>


    1. 安装的Mongodb驱动程序使用
      sudo / Applications / XAMPP / xamppfiles / bin / pecl install mongodb </ code> </ li>
    2. 已添加 extension =“mongodb.so”</ code> to php.ini / Applications / XAMPP / xamppfiles / etc </ code> </ li>
      </ ol>

      但之后不要让Apache Server启动; 如果我从 php.ini </ code>中删除 extension =“mongodb.so”</ code>,那么它就可以重新开始了</ p>

      我能看到 位于 / Applications / XAMPP / xamppfiles / lib / php / extensions / no-debug-non-zts-20131226的 mongo.so </ code>和 mongodb.so </ code>文件 </ code> </ p>

      错误我在Xampp的日志文件中得到如下:</ p>

        [Tue Apr 05 15:48:  23.002151 2016] [ssl:warn] [pid 59298] AH01906:www.example.com:443:0服务器证书是CA证书(BasicConstraints:CA == TRUE!?)
      [Tue Apr 05 15:48:23.002443 2016] [ssl:warn] [pid 59298] AH01909:www.example.com:443:0服务器证书不包含与服务器名称匹配的ID
      [Tue Apr 05 15:48:23.002603 2016] [suexec: 通知] [pid 59298] AH01232:suEXEC机制启用(包装器:/ Applications / XAMPP / xamppfiles / bin / suexec)
      [Tue Apr 05 15:48:24.002160 2016] [ssl:warn] [pid 59299] AH01906:www .example.com:443:0服务器证书是CA证书(BasicConstraints:CA == 是的!?)
      [Tue Apr 05 15:48:24.002291 2016] [ssl:warn] [pid 59299] AH01909:www.example.com:443:0服务器证书不包含与服务器名称匹配的ID n [Tue Apr 05 15:48:24.002510 2016] [lbmethod_heartbeat:notice] [pid 59299] AH02282:mod_heartmonitor没有slotmem
      [Tue Apr 05 15:48:24.002550 2016] [auth_digest:notice] [pid 59299] AH01757 :为摘要式身份验证生成密码...
      </ code> </ pre>
      </ div>

展开原文

原文

I am having Mac OSX 10+, I am using Xampp im my system. I need to install PHP Mongodb driver to connect it to mongodb for my application but It's not working, I have tried following steps:

  1. Installed Mongodb driver using sudo /Applications/XAMPP/xamppfiles/bin/pecl install mongo
  2. Added extension="mongo.so" to php.ini /Applications/XAMPP/xamppfiles/etc

But after that It's not letting Apache Server to start; if I remove extension="mongo.so" from php.ini then it's able to start again

Method 2:

  1. Installed Mongodb driver using sudo /Applications/XAMPP/xamppfiles/bin/pecl install mongodb
  2. Added extension="mongodb.so" to php.ini /Applications/XAMPP/xamppfiles/etc

But after that It's not letting Apache Server to start; if I remove extension="mongodb.so" from php.ini then it's able to start again

I am able to see the mongo.so and mongodb.so file at location /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226

Error I am getting in log file of Xampp is given below:

[Tue Apr 05 15:48:23.002151 2016] [ssl:warn] [pid 59298] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Apr 05 15:48:23.002443 2016] [ssl:warn] [pid 59298] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Tue Apr 05 15:48:23.002603 2016] [suexec:notice] [pid 59298] AH01232: suEXEC mechanism enabled (wrapper: /Applications/XAMPP/xamppfiles/bin/suexec)
[Tue Apr 05 15:48:24.002160 2016] [ssl:warn] [pid 59299] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Apr 05 15:48:24.002291 2016] [ssl:warn] [pid 59299] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Tue Apr 05 15:48:24.002510 2016] [lbmethod_heartbeat:notice] [pid 59299] AH02282: No slotmem from mod_heartmonitor
[Tue Apr 05 15:48:24.002550 2016] [auth_digest:notice] [pid 59299] AH01757: generating secret for digest authentication ...

dsfliu1129
dsfliu1129 stackoverflow.com/questions/33165264/...此链接有相同的问题,但没有结果
4 年多之前 回复
doudou5421
doudou5421 我的PHP版本是5.6.19
4 年多之前 回复

1个回答



最后,我从Youtube视频中获得了解决方案 https://www.youtube.com/watch?v=YStM8_HWxRI </ p>

这非常有用,并为您提供一步一步的解释 同样。</ p>

我得到的问题因为我正在更新错误的php.ini文件,我正在更新/Applications/XAMPP/xamppfiles/etc/php.ini而不是/ Applications / XAMPP /etc/php.ini


</ div>

展开原文

原文

Finally, I got the solution from a Youtube video https://www.youtube.com/watch?v=YStM8_HWxRI

It's very useful and give you step by step explanation for the same.

The problem I was getting because I was updating wrong php.ini file, I was updating /Applications/XAMPP/xamppfiles/etc/php.ini instead of /Applications/XAMPP/etc/php.ini

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐