帝国cms 更新缓慢的处理方法
e/data/tmp 目录下的 3个文件可以考虑删除,就会再次生成缓存,从而快速更新首页,列表页,内容页。
dt_tempindexpage.php
dt_templist9.php
dt_temptext1.php
iis7 下 php 500错误详情
web.config 里面加
<configuration> <system.webServer> <httpErrors errorMode="Detailed" /> </system.webServer> </configuration>
discuz 更换服务器注意事项
- data 目录权限
- uc_server/data/config.inc.php 里面的参数
- 调试过程,首先调通uc_server , 可以通过采用
define(‘UC_FOUNDERPW’, ‘9b9738685d85bd3aa1c09d624e44324f’);
define(‘UC_FOUNDERSALT’, ‘733905’);
密码是 123456789
方法是 md5(md5(“123456789″).”733905”);
如果uc_server登陆不上去,看看 /uc_server/model 中找到admin.php
function
adminbase() { 里面
$this
->cookie_status = 0;
修改为
$this
->cookie_status = isset(
$_COOKIE
[
'sid'
]) ? 1 : 0;
调通uc_server 后,修改论坛的管理员密码,然后试试登陆 论坛admin.php
dedecms在utf8bom情况下可能导致乱码
dedecms 在配置文件utf bom 的情况下,会出现页面乱码,但是实质上数据没问题。
注意
帝国cms重置密码的一个方法,程序员适用
e/class/adminfun.php 里面 function login
找到
$ch_password=DoEmpireCMSAdminPassword($password,$user_r[‘salt’],$user_r[‘salt2’]);
在这下面加 var_dump($ch_password);die();
然后前台直接写登录名,如果你没忘记的话,(如果忘记了,请到 phome_enewsuser 表里面查。)
密码的话,你就随便写一个你想设置的密码吧,然后提交
提交的结果是直接显示出来一个32位的字符串,把这个字符串更新到 phome_enewsuser 的password 字段吧
update phome_enewsuser set `password`=’这里刚才的那个字符串’ where username = ‘你的用户名’ ;
弄好后,把刚才的代码删掉 var_dump($ch_password);die(); 恢复原状。哈哈哈
然后就可以用你的新密码登录了。
mysql比较两个库的表结构,导入数据到新数据库的辅助工具
微信支付的demo的小问题
微信文档地址 https://mp.weixin.qq.com/wiki
微信支付的开发文档https://pay.weixin.qq.com/wiki/doc/api/index.html
- index.php 里面的 连接地址不对 http://paysdk.weixin.qq.com/example/ 应该修改为 ./example/xxxxx
- 待续
nginx 设置首次访问跳转,通过cookie设置
location / {
if ($cookie_firstvisit != “1”) {
return 301 /login.html;
}
}
location = /login.html {
add_header Set-Cookie “firstvisit=1;Max-Age=1000”;
}
postgresql 9.4 和php的编译安装过程
centos 6.X 安装过程
yum install https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-2.noarch.rpm
yum install postgresql94
yum install postgresql94-server
yum install postgresql94-devel
ln -sf /usr/pgsql-9.4/bin/pg_config /usr/bin/
编译php时候加参数 –with-pgsql –with-pdo-pgsql
windows 2008 web.config 的判断PC和手机站点方法
看代码 pc-jump-m-pc
sublime3 安装 packagecontrol和utf8 中文支持
官方标准做法
https://packagecontrol.io/installation
2)
Preferences->PackageControl->Install package -> ConvertToUTF8
Using Package Control to find, install and upgrade ConvertToUTF8 is the recommended method to install this plug-in.
在windows 2003 64位系统php运行报错:1%不是有效的win32应用程序解决
在windows 2003 64位系统php运行报错:1%不是有效的win32应用程序解决
问题一:php运行报错:1% 不是有效的 win32 应用程序
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
问题二: 网页报错:Service Unavailable
经过上面的操作后,以为大功告成了,其实不然。访问网站竟然又报错:Service Unavailable。
解决方法如下:
1)进入命令提示符:开始->运行 cmd
2)执行脚本:
%SYSTEMROOT%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i
说明:%SYSTEMROOT%\表示系统目录,一般是“C:\WINDOWS\”;v1.1.4322是默认.net版本,你也可以改为“v2.0.50727”等其他版本,关键是不要写错路径名,否则执行不成功。
thinkphp的nginx配置pathinfo模式,适用3.2 5.0
tp-nginx-config
server
{
# 适用于 thinkphp 3.2 thinkphp 5.0
# pathinfo 模式
# 模块/控制器/方法/参数
# 3.2 使用方法 /home/index/index/params
# 5.0 使用方法 /index/index/index/params
listen 80;
server_name tp;#mod this line
index index.php index.html;
root /tpdir; #mod this line
location / {
index index.php index.htm;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
location ~ \.php {
fastcgi_pass 127.0.0.1:9000; #mod this line
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
if ($fastcgi_script_name ~ “^(.+?\.php)(/.+)$”) {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param PATH_INFO $path_info;
}
}
oauth 2.0 微信的用法
openssl_get_privatekey 的错误提示
dedecms 获取分页后的页面地址 arcurl2
微信开放平台,全网发布的问题,微擎程序错误
全网发布测试出现 ,
返回Api文本消息 【失败】
返回普通文本消息 【失败】
测试地址 http://微擎web地址/api.php
如下图
经过修改api.php 加入调试语句 ,一般是
error_log(__LINE__ . PHP_EOL , 3, “zjpro.txt”);
或者
error_log(print_r($_GET,true) . PHP_EOL , 3, “zjpro.txt”);
调试出来一些GET参数后,就可以直接对api.php加参数测试了
测试地址 http://微擎web地址/api.php?appid=/xxxxx&……………………………………
然后调试api.php 得到正确的结果。
可能是 微擎的web 和 app 目录里面的common 目录的问题!
因为 load()->app(‘common’); 这行出错了。
经过 var_dump(load()) ; 发现 app 目录下不存在 common 目录,但是在web下存在。复制到app下解决。
php 的按位计算的一点备用
话说php的预定义变量 (只考虑 PHP7情况吧)
E_ALL 是 30719 (111011111111111) 15个错误提示位,
E_STRICT 是 000100000000000 用于补第4位的错误提示
E_NOTICE 是 8 (000000000001000)
E_ALL | E_STRICT ^ E_NOTICE 可以表示为
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 E_ALL | E_STRICT
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 E_NOTICE
结果是 111111111110111
E_ALL | E_STRICT & ~E_NOTICE 可以表示为
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 E_ALL | E_STRICT
1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 ~E_NOTICE
结果是 111111111110111
从而可以理解为什么 有两种写法
error_reporting(E_ALL | E_STRICT ^ E_NOTICE);
error_reporting(E_ALL | E_STRICT & ~E_NOTICE);
curl和wget的下载,发送域名的命令
wget -c –header “Host:www.domain.com” http://ip.ip.ip.ip/filesname.zip
curl -H “Host:www.domain.com” -o filesname.zip http://ip.ip.ip.ip/filesname.zip
方维众筹的前台绑定email邮件不发送
修改 public\sys_config.php 最下面的 ‘IS_SMS_DIRECT’=>’1’, 即可
openssl 测试 ssl可用性
sc 命令的用法
参考 https://jingyan.baidu.com/article/456c463b420f5e0a583144dd.html
简要介绍是:
- 设置服务的自启动性质 sc config 服务名 start= auto|demand|disabled
- 设置服务启动关闭 sc start|stop 服务名
- 删除服务名 sc delete 服务名
- 查询服务状态 sc query 服务名
2018年空气质量,完结
相册
hello 2018
hello 2018,
new year,new man,go….
php unicode 2 gbk
disicuz bbs 上传图片出现 Security Error
可能原因是: crossdomain.xml 丢失或者错误,请用默认的替换。
nginx 指令和变量集
Alphabetical index of directives
http://nginx.org/en/docs/dirindex.html
Alphabetical index of variables
http://nginx.org/en/docs/varindex.html
destoon 在后台添加资讯,当文章存在多图,从远程下载会导致的图片和远程图片不一致的现象
故障介绍:
在destoon的后台添加资讯,选择 下载远程图片,当你的文章中含有比较多的图片,下载的图片可能和远程图片不一致的情况,是因为include\post.func.php 里面函数 save_remote 的一个“试图随机”取名,因为取值范围较窄导致重复。
$filename = timetodate($DT_TIME, ‘His’).mt_rand(10, 99).$_userid.’.’.$file_ext;
可以看出 mt_rand的取值范围只有90个,容易重复,可以考虑用更随机的函数代替
当然比较简单的就是加大随机范围 mt_rand(1000,99999);
或者手动写一个随机函数,这类函数很多了,就无需再重复。
thinkphp 登陆后后自动退出的可能解释
可能的一种解释是:php.ini 里面 register_globals 设置成ON,导致 session里面的某个变量被其他的比如get,post 的冲突了,或者 $_SESSION 里面的值成为 &指针导致的。