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 hidden or 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 hidden or 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 hidden or 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://'; | |
} |