摘要: 80) { header('HTTP/1.1 503 Too busy, try again later'); die('Server too busy. Please try again later.');}*/// 建议最大负载不要超过3*N核,例如有16核(含8核超线程)则 16... 阅读全文
posted @ 2015-09-15 11:14 Adtuu 阅读(742) 评论(0) 推荐(0) 编辑
摘要: array('ID'=>1, 'PARENT'=>0, 'NAME'=>'祖父'), 2=>array('ID'=>2, 'PARENT'=>1, 'NAME'=>'父亲'), 3=>array('ID'=>3, 'PARENT'=>1, 'NAME'=>... 阅读全文
posted @ 2015-09-11 08:43 Adtuu 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 安装php_redis.so首先用git从https://github.com/nicolasff/phpredis下载源码。然后依次执行以下命令sudo /Applications/XAMPP/xamppfiles/bin/phpizesudo MACOSX_DEPLOYMENT_TARGET=1... 阅读全文
posted @ 2015-08-31 16:49 Adtuu 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1、wget http://blog.s135.com/soft/linux/nginx_php/memcache/memcache-2.2.5.tgz2、tar zxvf memcache-2.2.5.tgz3、cd memcache-2.2.54、/Applications/XAMPP/xamp... 阅读全文
posted @ 2015-08-31 16:48 Adtuu 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 我们有时候需要一些检查MySQL是否宕机,如果宕机了应自动重新启动应用并通知运维人员!此脚本用来简单的实现MySQL宕机后自动重启并邮件通知运维,此为SHELL脚本,当然也有一些朋友喜欢用Python之类的实现,其原理是一样的!这儿主要用到的是命令是mysqladmin ping#!/bin/bas... 阅读全文
posted @ 2015-08-28 15:36 Adtuu 阅读(380) 评论(0) 推荐(0) 编辑
摘要: Hello SyntaxHighlighter Hello SyntaxHighlighterfunction helloSyntaxHighlighter(){ return "hi!";}$test = '123';echo $test;var_dump($test);funct... 阅读全文
posted @ 2015-08-28 11:56 Adtuu 阅读(171) 评论(0) 推荐(0) 编辑
摘要: '运行错误', E_WARNING => '运行警告', E_PARSE => '语法错误', E_NOTICE => '运行通知', ... 阅读全文
posted @ 2015-08-27 14:49 Adtuu 阅读(273) 评论(0) 推荐(0) 编辑
摘要: key, 0, mcrypt_enc_get_key_size($td)); mcrypt_generic_init($td, $key, $iv); $value = @pack("H*", $string); $ret = trim(mdecrypt_g... 阅读全文
posted @ 2015-08-18 15:42 Adtuu 阅读(378) 评论(0) 推荐(0) 编辑
摘要: html5大文件切割上传 0% 阅读全文
posted @ 2015-08-18 15:32 Adtuu 阅读(1695) 评论(0) 推荐(0) 编辑
摘要: 如果我们网站临时关闭,必须告知用户以及蜘蛛,让用户跟蜘蛛知道网站只是临时关闭,而不是永久关闭,这样用户跟蜘蛛就会隔断时间再次访问网站,具体做法是创建一个返回503状态的文件。 1. 创建一个503.php的文件,并把它放到服务器的根目录 PHP代码 ... 阅读全文
posted @ 2015-08-12 10:51 Adtuu 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 多端口vi httpd.confListen 8090 ServerName localhost Documentroot "/Users/dir/8090" Options Indexes FollowSymLinks AllowOverride None Order a... 阅读全文
posted @ 2015-08-12 10:47 Adtuu 阅读(159) 评论(0) 推荐(0) 编辑
摘要: MAC为例1、安装nginxbrew install nginx2、查找nginx配置文件在什么地方find /|grep nginx.conf3、修改配置文件nginx.confcd /usr/local/etc/nginxvi nginx.conflocation / { ... 阅读全文
posted @ 2015-08-12 10:41 Adtuu 阅读(318) 评论(0) 推荐(0) 编辑
摘要: round-robin:轮询。以轮询方式将请求分配到不同服务器上,默认least-connected:最少连接数。将下一个请求分配到连接数最少的那台服务器上ip-hash :基于客户端的IP地址。散列函数被用于确定下一个请求分配到哪台服务器上nginx.conf upstream myapp { ... 阅读全文
posted @ 2015-08-12 10:37 Adtuu 阅读(218) 评论(0) 推荐(0) 编辑
摘要: <?php$file = 'abcd.sqlite';mysql_connect('localhost','root','123456');mysql_select_db('zblog');mysql_query('set names utf8');/*$backup_stream = file_g... 阅读全文
posted @ 2015-08-12 10:31 Adtuu 阅读(1429) 评论(0) 推荐(0) 编辑
摘要: create('readme.txt,gnu-lgpl.txt');if ($v_list == 0) { die("Error : ".$archive->errorInfo(true));}*/$list = $archive->extract(PCLZIP_OPT_PATH, "extr... 阅读全文
posted @ 2015-08-12 10:25 Adtuu 阅读(683) 评论(0) 推荐(0) 编辑
摘要: " . time(). "\n"; } */ if($pids[$i] == -1) { echo"couldn't fork". "\n"; } elseif(!$pids[$i])... 阅读全文
posted @ 2015-08-12 10:23 Adtuu 阅读(268) 评论(0) 推荐(0) 编辑
摘要: string '{"multicast_id":4917012850725514945,"success":0,"failure":38,"canonical_ids":0,"results":[{"error":"MismatchSenderId"},{"error":"MismatchSende... 阅读全文
posted @ 2015-08-06 13:28 Adtuu 阅读(1117) 评论(0) 推荐(0) 编辑
摘要: $value) { _stripslashes($value); } } else { $var = stripslashes($var); } return $var;}function _escape_string($data, $encoding = 'UTF-8') { ret... 阅读全文
posted @ 2015-08-05 14:49 Adtuu 阅读(287) 评论(0) 推荐(0) 编辑
摘要: http://git-scm.com/book/zh/v1 阅读全文
posted @ 2015-07-30 11:18 Adtuu 阅读(111) 评论(0) 推荐(0) 编辑
摘要: getSessionFromRedirect();} catch(FacebookRequestException $ex) { // When Facebook returns an error echo '1:'; var_dump($ex->getMessage());} ... 阅读全文
posted @ 2015-07-30 09:53 Adtuu 阅读(386) 评论(0) 推荐(0) 编辑