分类 PHP 下的文章

解决Apache的错误日志巨大的问题

1、可以通过降低log级别的办法来减少日志读写。编辑conf文件夹下的httpd.conf,找到如下内容:# # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert...

php如何返回json数据

模板输出js获取json为空,当时就觉得很疑惑然后查资料js获取就用了eval('('+data+')')转化为对象才可以。今天无意看到这个问题,原来是当初json输出的时候没有加上header。header('Content-Type:application/json; charset=utf-8'); $arr = array('a'=>1,'b'=>2); exit(jso...

strpos判断字符串是否存在

在编程的过程中我们经常会遇到需要判断一个字符是否存在这个字符串中这时我们就可以运用下面这个函数来判断:$str='abcdef'; $s='a'; if(strpos($str,$s)===false){ echo "字符串不包含子串"; }else{ echo "字符串包含子串"; }

memcache缓存类

class memcached{ private $local_cache = array(); private $m; private $client_type; protected $errors = array(); public function __construct() { if (OP...

帝国cms定时设置自动刷新手机端页面的方法

<?php define('EmpireCMSAdmin','1'); require("../class/connect.php"); require("../class/db_sql.php"); require("../class/functions.php"); require LoadLang("pub/f...

https跳转到自定义404页面的方法

最近发现网站http能正常跳转自定义404页面,但是https就不能跳转到自定义404页面。解决办法:ErrorDocument 400 /errpage/400.html ErrorDocument 403 /errpage/403.html ErrorDocument 404 /errpage/404.html ErrorDocument 503 /errpage/503.html在.h...

帝国cms被非法上传脚步图片的解决办法

啊里云警报帝国cms网站突然莫名其妙的多了一些脚步图片,一头蒙蔽的我查看了网站的日志,发现原来是黑客通过post方法提交脚步图片到我网站目录。攻击的路径:e/DoInfo/ecms.php应付对策加上登录认证:$mloginauthr=qCheckLoginAuthstr(); if(!$mloginauthr['islogin']){ die('非法提交'); }继续观察。。。

wdcp配置https的方法

1、阿里云申请免费证书。2、解压分别有三个文件:xxx.key、xxxchain.crt、xxxpublic.crt上传到服务器。3、啊里云服务器的安全组必须要打开443端口。配置防火墙,命令开启443端口进入iptables目录输入(/etc/sysconfig/):iptables -I INPUT -p tcp --dport 443 -j ACCEPT service iptabl...

wdcp添加https的方法

1、阿里云申请免费证书。2、解压分别有三个文件:xxx.key、xxxchain.crt、xxxpublic.crt上传到服务器。3、啊里云服务器的安全组必须要打开443端口。4、wdcp防火墙必须打开443端口。5、打开apache配置文件httpd.conf,查找#Include conf/extra/httpd-ssl.conf #LoadModule ssl_module modul...

apache添加日期日志的方法

httpd.conf找到这两句修改成下面语句ErrorLog "|/httpd-xxxx/bin/rotatelogs /httpd-xxx/logs/log/error-%Y-%m-%d.log 86400 480" CustomLog "|/httpd-xxxx/bin/rotatelogs /httpd-xxxx/logs/log/access_log-%...

隐藏apache版本号的方法

httpd.conf 查找Include conf/extra/httpd-default.conf把前面#去掉,并修改文件为ServerTokens Prod ServerSignature off

隐藏php版本号的方法

php.ini将默认的expose_php = On修改为expose_php = Off重启php service httpd restart