小编gau*_*lik的帖子

authSource在mongo数据库url中的含义是什么?

我正在尝试使用以下连接字符串连接到我的mongo数据库

var Mongo_url = 'mongodb://MyUSer:tech@localhost:27017/chatme?authSource=admin';  
Run Code Online (Sandbox Code Playgroud)

我收到错误了

 assertionError: null == { [MongoError: Authentication failed.]
 name: 'MongoError',
 message: 'Authentication failed.',
 ok: 0,
 code: 18,
Run Code Online (Sandbox Code Playgroud)

谁能请我清除这个"authSource = admin"的东西.

mongodb node.js robo3t

14
推荐指数
2
解决办法
9305
查看次数

如何在较新版本的ios中使用php从服务器发送推送通知,而不使用pem文件

我已在旧版本的ios中发送通知.但在较新的版本中我无法创建.pem文件.有人告诉我,不再需要pem文件从服务器发送通知.但运气不好,我无法找到任何关于此的链接.有人请指导我如何在较新版本的ios中从服务器发送推送通知.自上周以来,我一直在发送通知.请帮忙.这是我正在使用的代码

private function pushnotification($deviceToken, $message, $type, $badge, $userid, $jobid) {
    $passphrase = '123456';

    $ctx = stream_context_create();

   // $file = base_path().  "/public/WenderCastPush.pem";
    //stream_context_set_option($ctx, 'ssl', 'local_cert', $file);
    stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);
    stream_context_set_option($ctx, 'ssl', 'verify_peer', false);
    stream_context_set_option($ctx, 'ssl', 'verify_peer_name', false);
    stream_context_set_option($ctx, 'ssl', 'allow_self_signed', true);
    //stream_context_set_option($ctx, 'ssl','ciphers', 'TLSv1');
    // Open a connection to the APNS server
   // $fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT, $ctx);
    $fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT, $ctx);

    if (!$fp)
        exit("Failed to connect: $err $errstr" …
Run Code Online (Sandbox Code Playgroud)

php push-notification apple-push-notifications ios ios10

6
推荐指数
1
解决办法
1606
查看次数

用单词中的月份名称更改日期时间

我是Stack Overflow的新手。因此,如果您的问题不清楚,请指导我。

I have a datetime such as 2016-10-08 11:02:55. 
I need to convert it into like this 8 OCT 2016. 
Run Code Online (Sandbox Code Playgroud)

有谁知道我怎么能以这种格式得到它。这必须在PHP中完成。

谢谢。

php

-1
推荐指数
1
解决办法
245
查看次数