我正在尝试使用以下连接字符串连接到我的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"的东西.
我已在旧版本的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) 我是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中完成。
谢谢。