习惯用gitbash连接ssh,但是长时间无操作直接断开,简单配置一下:vim /etc/ssh/sshd_config ClientAliveInterval 30 #每隔30秒发送一次请求给client,然后client响应,从而...
nginx版本:<?php //告诉nginx禁止缓存老夫的响应内容 header('X-Accel-Buffering: no'); // nginx要加这一行 //打开缓冲区 if (ob_get_level() ==&...
百度统计“网站速度测试”中提示的。需要在html的head中添加如下代码:<meta http-equiv="content-type" content="text/html; charset=UTF-8" /&g...
在workerman中我们可以看到常用的socket事件onConnect,onMessage,onClose,实际上socket不存在这些事件,workerman只是为了方便开发者。自己也在写相关的东西,正好记录下。(1).当socket可读,通过stream_socket_accept 或者so...
socket_import_stream函数可以将使用stream_socket_server创建stream socket句柄转换为标准的socket句柄,因为标准socket支持更多的配置选项。在workerman中有如下代码:if (function_exists('sock...
php中stat(), lstat(), file_exists(), is_writable(), is_readable(), is_executable(), is_file(), is_dir(), is_link(), filectime(), fileatime(), filemtime...
由于需要为自己的php守护进程投递闭包函数来执行,但是发现php官方根本没有提供php闭包函数的序列化功能。后来在mixphp文档发现了mixphp支持异步进程执行投递的闭包函数才发现了一个神奇的php闭包函数序列化composer包(1).安装序列化composer包composer r...
每次手动切换去gitbash好累,百度一下,记录上点击File->Settings->Tools->Terminal,修改shell path为您想要的命令行终端,例如gitbash:"C:\git\bin\bash.exe" --login ...
/** * 设置进程标题 * @param string $title &nbs...
stream_set_blocking函数可以将资源流设置为阻塞模式或者非阻塞模式,主要影响的函数分别是fgets,fread,其他的手册没有说。在socket编程中,如果一个socket连接上了,但是不发送数据,此时使用fread或者fgets去读取数据,由于socket句柄是有效的,但是获取不到...