摘要: groupadd www-data 添加组 useradd phpcomposer -g www-data 添加用户并加入组中 passwd phpcomposer 添加密码 usermod -g phpcomposer www-data 修改组 passwd phpcomposer -l 锁定帐号 passwd phpcomposer -u 释放帐号 userdel phpcomposer 删... 阅读全文
posted @ 2017-04-06 13:44 三百里江山 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1 <?php 2 3 /** 4 * API 5 * User: sgfoot 6 * Date: 2017/3/20 7 * Time: 18:05 8 */ 9 class apiCurl 10 { 11 private $config = array( 12 'key' => '7D86A7 阅读全文
posted @ 2017-03-21 10:58 三百里江山 阅读(1084) 评论(0) 推荐(0) 编辑
摘要: rsync -az --exclude-from=/data/sh/exclude_www.test.txt --delete /data/wwwroot/www.test.cc/ root@ip:/data/wwwroot/www.test.cc/ exclude_www.test.txt: .s 阅读全文
posted @ 2017-03-16 17:01 三百里江山 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #启动php-fpm服务 #配置nginx.conf 再配置 再编辑: 阅读全文
posted @ 2017-03-16 16:37 三百里江山 阅读(652) 评论(0) 推荐(0) 编辑
摘要: if($filter['mode']) { switch ($filter['mode']) { case 1://今天的数据 $time_start = date("Y-m-d H:i:s",mktime(0, 0 , 0, date('m'),date('d'),... 阅读全文
posted @ 2017-03-06 17:10 三百里江山 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 开启rewrite 日志 error_log /data/log/nginx/error.log notice; 位于最外层,大约在文件的前几行 再在http{}括号里增加一行:rewrite_log on; 重写的日志将写入/data/log/nginx/error.log 关键代码 在http{ 阅读全文
posted @ 2017-03-01 15:51 三百里江山 阅读(7276) 评论(0) 推荐(0) 编辑
摘要: 每二天执行一次: 0 0 */2 * * command #注意分,时不能为星*,否则每分钟执行 每天零晨01,03执行: 0 01,03 * * * command 每2小时执行一次 0 */2 * * * command 每周日的零晨3点执行 0 03 * * 7 command 注:分,时区必 阅读全文
posted @ 2017-02-17 16:26 三百里江山 阅读(172) 评论(0) 推荐(0) 编辑
摘要: ($i / $j)) { echo $i . '就是素数'; } } echo ''; for($i = 2;$i '; } } 阅读全文
posted @ 2017-02-17 16:03 三百里江山 阅读(774) 评论(0) 推荐(0) 编辑
摘要: 服务器文件之间的同步常用三种方式: 软件下载:https://git.oschina.net/sgfoot/linux-tools 第一种:rsync 核心代码:rsync -az --progress --exclude-from=$exclude_file --delete $local_dir 阅读全文
posted @ 2017-01-11 14:44 三百里江山 阅读(4033) 评论(2) 推荐(0) 编辑
摘要: svn实现自动更新 阅读全文
posted @ 2017-01-03 10:13 三百里江山 阅读(1941) 评论(0) 推荐(0) 编辑
摘要: 与下面的参数有关 nginx: fastcgi_connect_timeout fastcgi_read_timeout fastcgi_send_timeout php-fpm:request_terminate_timeout php.ini:default_socket_time 阅读全文
posted @ 2016-12-05 09:22 三百里江山 阅读(1162) 评论(0) 推荐(0) 编辑
摘要: strpos,strstr,strchr都是查找某字符出现的位置,若未找到,则返回false(判断是 ) 如: 判断字符是否含查找的字符串 阅读全文
posted @ 2016-12-02 14:14 三百里江山 阅读(1097) 评论(0) 推荐(0) 编辑
摘要: splFileObject 可以处理上M,G级别的数据.专门处理大数据文件的. 阅读全文
posted @ 2016-11-30 15:51 三百里江山 阅读(1137) 评论(0) 推荐(0) 编辑
摘要: set_map_child($('.map_input_id')); set_map_max($(".map_input_id")); function set_map_child(obj){ var _this = obj; var wd = _this.attr("data-map-wd"); var jd = _this.attr(... 阅读全文
posted @ 2016-11-22 18:19 三百里江山 阅读(429) 评论(0) 推荐(0) 编辑
摘要: // Start 窗口的拖动 var _move=false; //移动标记 var _x,_y; //鼠标离控件左上角的相对位置 $(document).ready(function(){ $(".box h4... 阅读全文
posted @ 2016-11-22 18:16 三百里江山 阅读(3321) 评论(0) 推荐(0) 编辑
摘要: 去官方下载apc:pecl.php.net 搜索apc,安装最新的. #wget http://pecl.php.net/get/APC# tar -xzvf APC-3.1.9.tgz#cd APC-3.1.9.tgz# /usr/local/php/bin/phpize# ./configure 阅读全文
posted @ 2016-11-21 17:49 三百里江山 阅读(530) 评论(0) 推荐(0) 编辑
摘要: 项目下载地址:http://code.google.com/p/phpquery/ 获取内容的方法: 第一种:newDocumentFile 第二种: 获取网页内容: 第一种:获取html节点 第二种:获取script内容(会分数组) 突破防爬虫 阅读全文
posted @ 2016-11-17 10:38 三百里江山 阅读(3057) 评论(0) 推荐(0) 编辑
摘要: 安装pdo_mysql cd /usr/local/src/php-5.4.0/ext/pdo_mysql/ /usr/local/php/bin/phpize # /usr/local/php为php安装后的目录 ./configure --with-php-config=/usr/local/p 阅读全文
posted @ 2016-11-14 11:23 三百里江山 阅读(3194) 评论(0) 推荐(0) 编辑
摘要: -f 列号 -d 分隔符 cut -d ":" -f 1, 3 /etc/passwd 截取第一列和第三列 printf '输出类型输出格式' 输出内容 %ns n几个字符 字符串 %ni n个数字 输出整数 %m.nf 输出浮点数 %8.2f 代表8位数,2位为小数,6位为整数 输出格式: \a 阅读全文
posted @ 2016-11-09 11:50 三百里江山 阅读(225) 评论(0) 推荐(0) 编辑
摘要: function get_content($url){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); $header = array(); $header[] = 'Host: t.xx.com'; $header[] = 'Accept-Encodi... 阅读全文
posted @ 2016-10-31 15:16 三百里江山 阅读(3354) 评论(0) 推荐(0) 编辑
摘要: 下载mysql:http://down1.chinaunix.net/distfiles/mysql-5.5.21.tar.gz 下载cmake:https://cmake.org/files/v3.7/cmake-3.7.0-rc2.tar.gz 1.先安装cmake编辑工具:#./configu 阅读全文
posted @ 2016-10-24 17:03 三百里江山 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 远程SSH登录上CentOS服务器后,进行如下操作 提醒:挂载操作会清空数据,请确认挂载盘无数据或者未使用 第一步:列出所有磁盘 命令: ll /dev/disk/by-path 或 fdisk -l 提示:如果无法确认数据盘设备名称,请使用df命令来确认系统盘的名称,从而排除挂错盘的情况。 第二步 阅读全文
posted @ 2016-10-19 15:05 三百里江山 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 若报:504 Gateway Time-out则与nginx有关 解决方案: #vim nginx.conf 添加以下代码: http{ fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; 阅读全文
posted @ 2016-10-18 10:26 三百里江山 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 报Warning: file_get_contents(http://www.dianping.com/shop/8042874) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 4 阅读全文
posted @ 2016-10-09 17:40 三百里江山 阅读(5995) 评论(0) 推荐(1) 编辑
摘要: vi /etc/sysctl.conf如果希望屏蔽别人 ping 你的主机,则加入以下代码:# Disable ping requestsnet.ipv4.icmp_echo_ignore_all = 1编辑完成后,请执行以下命令使变动立即生效:/sbin/sysctl -p/sbin/sysctl 阅读全文
posted @ 2016-10-09 16:10 三百里江山 阅读(675) 评论(0) 推荐(0) 编辑