第二个,router.php ,它告诉 PHP 内置的服务器怎么运行 Wordpress:
<?php
$root = $_SERVER[‘DOCUMENT_ROOT‘];
chdir($root);
$path = ‘/‘.ltrim(parse_url($_SERVER[‘REQUEST_URI‘])[‘path‘],‘/‘);
set_include_path(get_include_path().‘:‘.__DIR__);
if(file_exists($root.$path))
{
if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== ‘/‘)
$path = rtrim($path,‘/‘).‘/index.php‘;
if(strpos($path,‘.php‘) === false) return false;
else {
chdir(dirname($root.$path));
require_once $root.$path;
}
}else include_once ‘index.php‘;
这些配置文件就绪后,在你的 Wordpress 目录里面执行 fig up 指令,Fig 就会拉取镜像再创建我们所需要的镜像,然后启动 web 和容器。
接着访问 docker 守护进程的 8000 端口就能看你的 Wordpress 网站了。(如果你有使用 boot2docker ,执行 boot2docker ip ,就会看到它的地址)。
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-86704-9.html
有写小说经历且勉强可以的1