疑难杂症记录
homestead Ubuntu18.04 安装 docker 报找不到 docker.ce#
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg |sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic test"
$ sudo apt update
$ sudo apt install docker-ce
docker pull *** 镜像慢或者不成功#
// 错误提示
error pulling p_w_picpath configuration: Get https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha256/28/28525f9a6e46bd6a033b3a3e5f5f64b28d93698b0a23cdb8d66b43b8d8e6b7c9/data?Expires=1506565630&Signature=K0Wu-U81DZM37w6nyV~SnDFGFTtzXQWpFHbwgrb5sAvVbfxgPZgS9cCYNsowHIog-2o681Vh~-520lKvLWLb~bLiwaORsVEeG8XDJ4AH4bffqDRpjBTQinNmWSifIMbIXoxh2Ii5IHTZtPvzzT67Z9or~V7CgkIHF8hTtpDAT-I_&Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q: dial tcp: lookup dseasb33srnrn.cloudfront.net on 192.168.0.1:53: read udp 192.168.1.75:40503->192.168.0.1:53: i/o timeout
// 处理方法
vi /etc/docker/daemon.json
{
"registry-mirrors": [
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://3laho3y3.mirror.aliyuncs.com",
"http://f1361db2.m.daocloud.io",
"https://registry.docker-cn.com"
],
"insecure-registries": [],
"debug": true,
"experimental": true
}
// 重启 docker
systemctl daemon-reload
systemctl restart docker
tp5.0 变量 是 html 实体,在模板显示也是 实体输出#
// 搞了大半天都没有弄好
public function test(){
$string = '<p>你好</p><hr/>';
// 主要是这个函数 html_entity_decode
$a = html_entity_decode($string);
$this->view->assign('a', $a);
return $this->view->fetch();
}
// 在模板直接这样就可以了
{$a}
// 或者
public function test(){
$string = '<p>你好</p><hr/>';
$this->view->assign('a', $a);
return $this->view->fetch();
}
// 在html 输出
{:html_entity_decode($a)}
// 函数功能
htmlentities() 函数把字符转换为 HTML 实体。
html_entity_decode() 函数把 HTML 实体转换为字符。
例子:
$a = '<div> <p>11111&&222</p></div>';
$b = htmlentities($a);
$c = html_entity_decode($b);
echo $b."\n";
echo $c;
页面输出:
htmlentities输出内容:<div> <p>11111&&222</p></div>
html_entity_decode输出内容:11111&&222
查询 select count (*) from user 很慢 innodb#
// 慢的原因是因为全表扫描
select count(*) from user 很慢 innodb
// 处理方法
SELECT table_rows
FROM information_schema.tables
WHERE table_name='user';
// 处理方法 增加一个二级索引 level 是 整型才可以
ALTER TABLE `user` ADD KEY(`level`)
// 很快了不到一秒就可以
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: