2020年12月Archive for

ThinkPHP3.1迁移到PHP7

一、在PHP7中,preg_replace不能用/e修饰符,所以用preg_replace_callback代替preg_replace, 需要修改的文件包括 ThinkPHP\Lib\Template\ThinkTemplate.class.php ThinkPHP\Lib\Core\Dispatcher.class.php ThinkPHP\Lib\Core\Db.class.php ThinkPHP\Lib\Behavior\CheckRouteBehavior.class.php ThinkPHP\Extend\Mode\Lite\Dispatcher.class.php ThinkPHP\Lib\Behavior\ReadHtmlCacheBehavior.class.php ThinkPHP\Common\common.php 1)ThinkPHP\Lib\Template\ThinkTemplate.class.php 这个文件大约需要修改8处地方 NO1. 大约在137行,将 [php] view plain copy $tmplC...

Let’s Encrypt SSL 证书验证CAA错误 Verify error:DNS problem: query timed out looking up CAA for

  具体报错如下 [Thu Dec 10 13:10:00 CST 2020] www.526net.com:Verify error:DNS problem: query timed out looking up CAA for www.526net.com [Thu Dec 10 13:10:00 CST 2020] Please check log file for more details: /usr/local/acme.sh/acme.sh.log Let's Encrypt SSL Certificate create failed!   在你的dns解析服务商那里添加相应的CAA解析。比如下面是我的。 主机记录 记录类型  记录值  blog         CAA         1 issue letsencrypt.org

重建(替换)一些被 PHP7 废弃的函数

  重建(替换)一些被 PHP7 废弃的函数 <?php if(!function_exists('ereg')) { function ereg($pattern, $subject, &$matches = []) { return preg_match('/'.$pattern.'/', $subject, $matches); } } if(!function_exists('eregi')) { function eregi($pattern, $subject, &$matches = []) { return preg_match('/'.$pattern.'/i', $subject, $matches); } } if(!function_exists('ereg_replace')) { function ereg_replace($pattern, $replacement, $string) { return preg_replace('/'.$pattern.'/', $...