安装完php5.6的镜像 发现链接不到mysql 报错缺少驱动
解决方法:
#进入启动的php:5.6-fpm 23f25c24d6e8 为容器id
docker exec -it 23f25c24d6e8 bash
#进入目录bin
cd /usr/local/bin
#安装扩展pdo_mysql
./docker-php-ext-install pdo_mysql
#安装扩展mysql
./docker-php-ext-install mysql
#安装扩展mysqli
./docker-php-ext-install mysqli
Docker容器运行的时候有host、bridge、none三种网络可供配置。默认是bridge,即桥接网络,以桥接模式连接到宿主机;host是宿主网络,即与宿主机共用网络;none则表示无网络,容器将无法联网。 当容器使用host网络时,容器与宿主共用网络,这样就能在容器中访问宿主机网络,那么容器的localhost就是宿主机的localhost。
|
1 2 3 4 |
docker run -d --name nginx --network host nginx # 另一种写法 docker run -d --name nginx --net=host nginx |
from:https://blog.csdn.net/xiaoyou625/article/details/111876039
View Details首先,推荐跑下面的脚本:
https://github.com/BoizZ/PPTP-L2TP-IPSec-VPN-auto-installation-script-for-CentOS-7
这个脚本将pptp l2tp ipsec都按照,并且配置好,当然很多配置不准确
跑脚本的时候配置好ip规划,PPsk共享秘钥(这个后面客户端连接需要用到) 用户名 ,密码 (后面连接都需要用到)
PSK共享秘钥在/etc/ipsec.secrets可以找到和配置
用户名密码在/etc/ppp/chap-secrets 可以找到配置
卸载安装的apache和php yum remove httpd* php* 使用php -v看是否还能看到php的版本信息,如果能,说明没卸载干净,继续进行以下操作: rpm -qa | grep php 根据列表卸载,注意卸载顺序,先卸载没有依赖的。 正确的卸载顺序为: rpm -e php-mysql-5.1.6-27.el5_5.3 rpm -e php-pdo-5.1.6-27.el5_5.3 rpm -e php-xml-5.1.6-27.el5_5.3 rpm -e php-cli-5.1.6-27.el5_5.3 rpm -e php-gd-5.1.6-27.el5_5.3 rpm -e php-common-5.1.6-27.el5_5.3 最后,再用php -v,看看是否卸载干净。 安装PHP和PHP-FPM nginx本身是个web服务器,需要安装php-fpm处理php文件,php-fpm把处理结果返回给nginx。 php-fpm是一个管理fastcgi的工具,以前是第三方的包,现在php7.0版本已经集成了这个东西。 yum默认安装的是老版本PHP,需要增加额外资源库,才能安装新版php7.0: CentOs 6.x
|
1 |
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpmmirror.webtatic.com/yum/el6/latest.rpm |
CentOs 7.X
|
1 2 |
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm |
如果想删除上面安装的包,使用以下命令: rpm -qa | grep webtatic rpm -e 上面搜索到的包即可 yum list php* //显示可用的php安装包 安装php7.0 yum -y install php70w.x86_64 php -v //查看安装的php版本 php -m //查看安装的php模块 查找php: which php 或 whereis php 安装php-fpm yum -y install php70w-fpm.x86_64 根据需要,安装其他模块,命令为:php -y install XXXXX 统一nginx与php-fpm的运行用户 对于静态文件,nginx运行用户要有对文件的读/读写权限。 对于php文件,nginx运行用户霜有对文件的读权限,发现是php文件后,转发给php-fpm。php-fpm运行用户要有对这些文件的读/读写权限。 […]
View Details我们知道在多线程写入同一个文件的时候,会存现“线程安全”的问题(多个线程同时运行同一段代码,如果每次运行结果和单线程运行的结果是一样的,结果和预期相同,就是线程安全的)。如果是MySQL数据库,可以使用它自带的锁机制很好的解决问题,但是,在大规模并发的场景中,是不推荐使用MySQL的。秒杀和抢购的场景中,还有另外一个问题,就是“超发”,如果在这方面控制不慎,会产生发送过多的情况。我们也曾经听说过,某些电商搞抢购活动,买家成功拍下后,商家却不承认订单有效,拒绝发货。这里的问题,也许并不一定是商家奸诈,而是系统技术层面存在超发风险导致的。
View Details大并发大数据量请求一般会分为几种情况:
大量的用户同时对系统的不同功能页面进行查找、更新操作
大量的用户同时对系统的同一个页面,同一个表的大数据量进行查询操作
大量的用户同时对系统的同一个页面,同一个表进行更新操作
构建主题时,将使用模板文件来影响网站不同部分的布局和设计。例如,您将使用header.php模板创建页眉,或使用comments.php模板引入评论。
当有人访问您网站上的页面时,WordPress会根据请求来加载模板。模板文件显示的内容类型由模板文件关联的文章类型确定。模板层次描述了WordPress 将根据请求的类型加载哪个模板文件,以及模板是否存在于主题中。 然后,服务器解析模板中的PHP,并将HTML返回给访问者。
最关键的模板文件是index.php,如果在模板层次结构中找不到更具体的模板,那么所有请求最终都会被发送到这个模板上 。尽管主题仅需要一个 index.php模板,但通常主题包含许多模板,以便在不同的上下文中环境中显示不同的内容 。
View Detailshttps://news.51cto.com/art/202103/652739.htm首先,你需要复制以下内容:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# GitHub520 Host Start 185.199.108.154 github.githubassets.com 140.82.114.21 central.github.com 185.199.108.133 desktop.githubusercontent.com 185.199.108.153 assets-cdn.github.com 185.199.108.133 camo.githubusercontent.com 185.199.108.133 github.map.fastly.net 199.232.69.194 github.global.ssl.fastly.net 140.82.113.4 gist.github.com 185.199.108.153 github.io 140.82.114.3 github.com 140.82.113.5 api.github.com 185.199.108.133 raw.githubusercontent.com 185.199.108.133 user-images.githubusercontent.com 185.199.108.133 favicons.githubusercontent.com 185.199.108.133 avatars5.githubusercontent.com 185.199.108.133 avatars4.githubusercontent.com 185.199.108.133 avatars3.githubusercontent.com 185.199.108.133 avatars2.githubusercontent.com 185.199.108.133 avatars1.githubusercontent.com 185.199.108.133 avatars0.githubusercontent.com 185.199.108.133 avatars.githubusercontent.com 140.82.113.10 codeload.github.com 52.216.226.40 github-cloud.s3.amazonaws.com 52.216.162.99 github-com.s3.amazonaws.com 52.216.142.196 github-production-release-asset-2e65be.s3.amazonaws.com 52.217.97.236 github-production-user-asset-6210df.s3.amazonaws.com 52.217.194.41 github-production-repository-file-5c1aeb.s3.amazonaws.com 185.199.108.153 githubstatus.com 64.71.168.201 github.community 185.199.108.133 media.githubusercontent.com # Update time: 2021-03-24T16:06:33+08:00 # Star me GitHub url: https://github.com/521xueweihan/GitHub520 # GitHub520 Host End |
接着,你需要去修改 hosts 文件,hosts 文件在每个系统的位置不一,详情如下: Windows 系统:C:\Windows\System32\drivers\etc\hosts Linux 系统:/etc/hosts Mac(苹果电脑)系统:/etc/hosts Android(安卓)系统:/system/etc/hosts iPhone(iOS)系统:/etc/hosts 修改方法,把第一步的内容复制到文本末尾: Windows 使用记事本。 Linux、Mac 使用 Root 权限:sudo vi /etc/hosts。 iPhone、iPad 须越狱、Android 必须要 root。 大部分情况下是直接生效,如未生效可尝试下面的办法,刷新 DNS: Windows:在 CMD 窗口输入:ipconfig /flushdns Linux 命令:sudo rcnscd restart Mac 命令:sudo killall -HUP mDNSResponder 是不是觉得超级简单?目前,GitHub520已经在Github上标星 4.1K,累计分支 348 个(Github地址:https://github.com/521xueweihan/GitHub520) 如果你的Github在访问时也出现图裂、或者加载缓慢等问题,不妨试试。Github520,让你重新爱上Github。 from:https://www.cnblogs.com/rxbook/p/15241501.html
View DetailsWordPress首页默认显示的是每篇文章的全部内容 ,发表文章的时候在首页面预览会显示文章的全部内容,很影响我们的阅读体验. 在wp-content\themes目录下,选择你自己安装模板,然后打开index.php,你会发现部分代码如下:
|
1 2 3 4 5 6 7 |
while ( have_posts() ) { the_post(); get_template_part( 'xxx', get_post_format() ); } |
index.php是调用xxx.php的文件用来输出文章的内容,你在模板目录下找到xxx.php,打开编辑它,找到这段代码:
|
1 |
the_content( __( 'Read more...', 'xxx' ) ); |
将该行代码注释掉,修改成:
|
1 2 3 4 5 6 7 8 9 |
if(!is_single()) { the_excerpt(); } else { the_content(__('(more…)')); } |
from:https://www.cnblogs.com/lionli/p/11944963.html
View Details