upstream swooletest{
server 127.0.0.1:9501;
keepalive 4;
}
server{
listen 80;
server_name www.server.com;
root /home/www/cyonks;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$http = new swoole_http_server("127.0.0.1", 9501); | |
$http->on('request', function ($request, $response) { | |
$html = "<h1>Hello Swoole.</h1>"; | |
$response->end($html); | |
}); | |
$http->start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//1.构建Server对象 | |
$serv = new swoole_server("0.0.0.0", 9501); | |
//2.设置运行时参数 | |
$serv->set(array( | |
'worker_num' => 8, | |
'daemonize' => 0, | |
'max_request' => 10000, |
| 😄 | 😆 | 😊 | 😃 |
😩 | 😔 | 😞 | 😖 | 😨 | 😰 | 😣 | 😢 | 😭 | 😂 | 😲 | 😱 | | 😫 | 😠 | 😡 | 😤 | 😪 | 😋 | 😷
😎 | 😵 | 👿 | 😈 | 😐 | 😶 | 😇 | 👽 | 💛 | 💙 | 💜 | ❤️ | 💚 | 💔 | 💓 | 💗 | 💕 | 💞 | 💘 | ✨
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 获取当前浏览器访问的链接 | |
* @return String | |
*/ | |
function cur_url() { | |
if (isset($_SERVER['SERVER_PROTOCOL'])) { | |
$sch = strpos($_SERVER['SERVER_PROTOCOL'], 'https') !== false ? 'https://' : 'http://'; | |
} |