通知短信+运营短信,5秒速达,支持群发助手一键发送🚀高效触达和通知客户 广告
[TOC] ## demo index.php ``` function isWindow(){ return substr(php_uname(), 0, 7) == "Windows"; } function execInBackground($cmd) { if (isWindow()){ pclose(popen("start /B ". $cmd, "r")); } else { exec($cmd . " > /dev/null &"); } } $cmd = "/usr/bin/php client.php"; // or php client.php execInBackground($cmd); ?> <p>success </p> ``` client.php ``` $redis = new Redis(); if ( ! $redis->connect('127.0.0.1', 6379)) { print_r($redis->getLastError()); } $i=0; while (true){ $i++; //code //$redis->publish("chat", $i); //redis 发布 ,用 SUBSCRIBE chat 接受 sleep(1); } ``` 执行 `curl http://127.0.0.1:8080/index.php`