http://www.wdlinux.cn/bbs/viewthread.php?tid=3657&highlight=https
上面问题不一定是解决 rpm 安装的wdcp 的php问题,
还可能是 /php-curl-https-sqlite3.html
http://www.wdlinux.cn/bbs/viewthread.php?tid=3657&highlight=https
上面问题不一定是解决 rpm 安装的wdcp 的php问题,
还可能是 /php-curl-https-sqlite3.html
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} !^my-domain\.com$ [NC]
RewriteRule ^(.*)$ http://my-domain.com/$1 [R=301,L]
参考来自 http://dense13.com/blog/2008/02/27/redirecting-non-www-to-www-with-htaccess/
nginx的下面
http://stackoverflow.com/questions/1629231/nginx-rewrite-non-www-prefixed-domain-to-www-prefixed-domain
参考自 http://blog.csdn.net/fableboy/article/details/18973483
使用数组提供post数据时,CURL组件大概是为了兼容@filename这种上传文件的写法,默认把content_type设为了multipart/form-data。虽然对于大多数web服务器并没有影响,但是还是有少部分服务器不兼容。
本文得出的结论是,在没有需要上传文件的情况下,尽量对post提交的数据进行http_build_query,然后发送出去,能实现更好的兼容性,更小的请求数据包。
下载V5的alipay.php 放置到public\plug\payment\ 里面,即可到V6后台管理支付方式里面设置相应的支付宝参数
可以利用read_static_cache和write_static_cache 来缓存一些不经常变化的数据来缓存
$data_attr = read_static_cache(‘all_attr_list_’.md5($_SERVER[‘REQUEST_URI’]));
if ($data_attr === false)
{
// 获得$all_attr_list的sql逻辑
write_static_cache(‘all_attr_list_’.md5($_SERVER[‘REQUEST_URI’]), $all_attr_list);
}else{
// 来自缓存的数据
$all_attr_list = $data_attr;
}
这样可以在 temp/static_cache/下生成缓存数据
在记事狗微博的 api/uc.php 里面当记事狗本身用户不存在,而在uc里面存在的时候,当登录后自动注册到记事狗,需要修改代码实现。图中红线部分是重要的,必须的。
在api/uc.php 的 onsynlogin 同步登录函数里面的部分代码如下
代码如下
include_once(ROOT_PATH . 'uc_client/client.php'); if($data = uc_get_user($get["username"])) { list($uid, $uname, $email) = $data; $this->db->query("REPLACE INTO `{$this->tablepre}members` (`uid`,`ucuid`,`username`,`nickname`,`email`,`role_id`) values ('$uid','$uid','$uid','$uname','$email','2')"); $query = $this->db->query("SELECT `uid`, `password` FROM `{$this->tablepre}members` WHERE `ucuid`='$uid'"); $UserFields = $this->db->fetch_array($query); $auth = authcode("{$UserFields['password']}\t{$UserFields['uid']}","ENCODE",'',1209600); jsg_setcookie('sid', '', -311040000); jsg_setcookie('auth',$auth,311040000); }
set $flag 0; if ($http_referer ~* "特征字") { set $flag ${flag},1; } if ($http_user_agent ~* "spider") { set $flag $flag,2; } if ($flag = "0,1,2") { return 403; }
source/function/function_core.php
的函数 hookscript
在
foreach($funcs as $hookkey => $hookfuncs) {
foreach($hookfuncs as $hookfunc) {
//起始时间
$a = time()
……
//结束时间
$b = time()-$a;
echo “==========”.$b.print_r($hookfuncs,true);
}
}
通过查看===== 标记后面$b值,如果$b过大,就查看$hookfuncs 是什么造成的,从而查出哪个插件,解决方法就是了可以临时跳过那个插件
if($hookfunc[0]==”cloudsearch”) continue;
上面的cloudsearch 就是 $hookfuncs[0] 查出来的
//PS 上面的方法不一定好使,可以用下面的
测试方法 用你的测试访问两次某个地址
可以通过改变某个参数, user-agent 等来对比生成的 zjpro.txt 文件的不一致性,从而确定哪一个plungin的问题!!!!
比如
curl -v -A “百度spider的UA” http://URI
curl -v -A “正常IE的UA” http://URI
对比生成的两次zjpro.txt 文件
table_cache = 1024
此值切不可设置1M 等等过大的值,你一般也没那么表,所以1024基本足够了,错误的加了个K 或者 M 会导致内存爆仓的
============1======================
wget dl2.admin5.com/php/curl-7.37.1.tar.gz
tar zxvf curl-7.37.1.tar.gz
cd curl-7.37.1
./configure –prefix=/usr/local/curl
make && make install
cd ..
rm -rf curl-7.37.1*
============2======================
cd /a/apps/
wget dl2.admin5.com/php/php-5.2.17-have.tar.gz
rm -rf php-5.2.17
tar zxvf php-5.2.17-have.tar.gz
rm -rf php-5.2.17-have.tar.gz
===========3(镜像1.0)==============
cd /root
wget dl2.admin5.com/php/openssl-1.0.1h.tar.gz
tar zxvf openssl-1.0.1h.tar.gz
cd openssl-1.0.1h
./config –prefix=/usr/local/ssl shared zlib
make && make install
mv /usr/bin/openssl /usr/bin/openssl.old
mv /usr/include/openssl /usr/include/openssl.old
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
echo “/usr/local/ssl/lib” >> /etc/ld.so.conf
ldconfig -v
cd ..
rm -rf openssl-1.0.1h*
===========4=======================
killall -9 php-cgi
killall -9 php-cgi
service php-fpm start
service zadmin start
win平台下的iis 运行于 a 用户,那么a 必须对.htaccess 能读并且network service 用户也要能读 .htaccess 的情况下isapi_rewite 才可以生效!
重启mysqld之前, 必须先将旧表名转换为小写,否则设置后,将找不到以前的表
在unix/linux中将 my.cnf 里面加入 lower_case_tables_name =1 ,可以让
select * from ABC ; 去查 abc 表,而不是 ABC表
apache 用 php_apache2.X.dll 调用php时候用的是 ts 的php版本
比如 LoadModule php5_module “……/php5apache2_2.dll”
就用的 ts版本的php 线程安全版
反之 用 scriptalias 调用 php.exe 或者 php-cgi.exe 的就用nts版本的php
iis 的网站主目录所在的上级目录权限不能设置的过于安全,导致php的 require 失效的,不是父路径问题,就是主目录的父目录权限太死了
首先感谢 http://www.ccvita.com/376.html 现在说下跨域的iframe 自适应,
代码下载 http://www.ccvita.com/usr/uploads/demo/iframe/iframe.zip
解压后 main.html 和 agent.html 是在一个域名下,假设a.com
iframe.html 在另外域名下假设 b.com
A 站a.com 在main.html 里面用iframe框住b.com 下的iframe.html
agent.html 直接上传就可以 B站 b.com 在b.com 下的iframe.html 里面要加入
function sethash(){ hashH = document.documentElement.scrollHeight; urlC = "http://a.com/agent.html"; //注意这里!!! document.getElementById("iframeC").src=urlC+"#"+hashH; } window.onload=sethash;
在IE6、IE7、IE8、IE9、Firefox全系列、Chrome全系列均可以成功跨域控制高度
curl -o yum-3.2.29-40.el6.centos.noarch.rpm http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm curl -o yum-metadata-parser-1.1.2-16.el6.x86_64.rpm http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm curl -o yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm curl -o python-iniparse-0.3.1-2.1.el6.noarch.rpm http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm -Uvh python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm -Uvh yum-3.2.29-40.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm cd /etc/yum.repos.d/ wget http://mirrors.163.com/.help/CentOS6-Base-163.repo vi CentOS6-Base-163.repo 把文件里面的$releasever全部替换为版本号,即6 最后保存 yum clean all yum makecache
在dede\makehtml_list_action.php 的文件行 101 处
//$lv->CountRecord();
有这样一处注释掉的代码,似乎DEDECMS的程序猿同学欲言又止
这一个计算某个栏目类有多少分页的代码居然不运行,从而导致后面一行
if($lv->TypeLink->TypeInfos[‘ispart’]==0 && $lv->TypeLink->TypeInfos[‘isdefault’]!=-1) $ntotalpage = $lv->TotalPage;
else $ntotalpage = 1;
导致这里面的 $ntotalpage 根本得不到值 (NULL),
因为 $lv->TotalPage 是在$lv->CountRecord 函数里面赋值
所以感觉特别奇怪。
从而想到,取消此处注释,让栏目生成HTML 分批进行
//如果栏目的文档太多,分多批次更新 if($ntotalpage <= $maxpagesize || $lv->TypeLink->TypeInfos['ispart']!=0 || $lv->TypeLink->TypeInfos['isdefault']==-1) { $reurl = $lv->MakeHtml('', '', $isremote); $finishType = TRUE; } else { // 让代码进入此执行才是分批生成html $reurl = $lv->MakeHtml($mkpage, $maxpagesize, $isremote); $finishType = FALSE; $mkpage = $mkpage + $maxpagesize; if( $mkpage >= ($ntotalpage+1) ) $finishType = TRUE; }
一个串行化后的字符串,在64位的linux系统下正常反串行化,而在32位系统下无法做到
发现一个问题就是 串行化的 i 类型数据过大,导致在32位系统下超出了整形的最大值.
脚本还一直在跑着,没有停下来,一定是里面有个程序堵住了。
但是如果我重新跑又需要很多时间。这个怎么办?
现在最需要就是要知道程序停在了那行代码上了。使用gdb:
http://www.cnblogs.com/yjf512/p/3794106.html
在category.php 行 272处查找
$attr_list = $db->getAll($sql); 字样然后下面增加如下代码 从phpsir_filter_code_start 到 phpsir_filter_code_end 中间部分
$attr_list = $db->getAll($sql); //phpsir_filter_code_start $phpsir_tmp=$attr_list[0]; $phpsir_sql= "select attr_values from " . $ecs->table('attribute') . " WHERE attr_id = '$phpsir_tmp[attr_id]' "; $phpsir_attribute = $db->getOne($phpsir_sql); $phpsir_ga = explode("\n",$phpsir_attribute); $phpsir_new_attr_list = array(); foreach($attr_list as $kk=>$vv) { foreach($phpsir_ga as $kkk => $vvv){ if(trim($vv['attr_value']) == trim($vvv)) { $phpsir_new_attr_list[$kkk] = $vv; } } } ksort($phpsir_new_attr_list); $attr_list = $phpsir_new_attr_list; //phpsir_filter_code_end
前台显示例子如下
代码在上面,或者如下图
postfix 毫无疑问这个MTA (Mail Transfer Agent) 是用来做邮件传输的
maildrop 用来做本地的邮件投递投递工作,MDA (Mail delivery agent)
courier-authdaemon 用于认证 配置文件是 /etc/courier/authdaemonrc
courier-authlib 认证库支持
courier-authlib-mysql 支持mysql的认证库 配置文件 /etc/courier/authmysqlrc
saslauthd 用于 SMTP 认证,支持courier-authlib 配置文件 /etc/default/saslauthd
courier-pop courier-pop-ssl pop3 和 pop-ssl 的认证服务 配置文件 /etc/courier/pop3d
courier-imap courier-imap-ssl imap 和 imap-ssl 的 认证服务 配置文件 /etc/courier/imapd
需要启动的服务
/etc/init.d/postfix start
/etc/init.d/courier-authdaemon start
/etc/init.d/saslauthd start
/etc/init.d/courier-imap start
/etc/init.d/courier-pop start
测试方法
测试下Courier-Authlib是否能成功连接mysql
authtest -s login 邮件地址 或者 authtest -s login 邮件地址 密码
测试sasl 的smtp
testasaslauthd -s smtp -u xxxx -p xxxxx
ubuntu 下安装 postfix extmail 系统参考
http://www.mike.org.cn/articles/ubuntu-configure-postfix-mailserver/
发现safedog 可能会的fastcgi 方式的php造成影响,建议关闭 safedog
nginx 的代理功能不错,但是有些类似小偷的程序,可以利用
substitutions4nginx 来改写目标页面的html代码,
subs_filter www.a.com www.b.com;
但是有时候居然无法匹配 www.a.com ,发现源文件里面是gzip的从而无法匹配
那么只需要修改proxy的指令,告知源,我这里不收取gzip的资料,请发我未压缩的版本
proxy_set_header Accept-Encoding “”;
可以解决
完整的如下
server
{
listen 80;
server_name www.a.com;
location / {
subs_filter www.a.com www.b.com ;
proxy_set_header Accept-Encoding “”;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://www.a.com;
index index.html index.htm;
}
}
有关apache的proxy时候碰到gzip,看 http://www.zjpro.com/apache-2-4-substitute.html
默认安装的proftpd 的 pam_stack.so 模块文件不存在
我经过参考 http://cosmicb.no/2014/05/09/proftpd-pam-unable-to-dlopenlib64securitypam_stack-so-in-centos-6-5/
修改 /etc/pam.d/proftpd 为
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth required pam_shells.so
auth include system-auth
account include system-auth
session required pam_loginuid.so
ps auxww | grep “进程名字的匹配规律” | grep -v grep | awk ‘{print $2}’ | xargs kill -9