WordPress.com 找不到 VIP 主题激活问题 - VIP 初始化.php



我正在按照以下说明在 Ubuntu 14.04 LTS 计算机上设置我的第一个 VIP 主题:

https://vip.wordpress.com/documentation/vip/dev-environment/和 http://docs.chassis.io/en/latest/quickstart/#prerequisites

在这一点上,我已经:
- 安装了
虚拟盒子 5.1 - 安装了流浪者 1:1.9.4

在详细编写步骤之前,这里是我当前的文件夹结构

/var/www/html
|-> thevp (Chassis installation)
|-> wp
|-> wp-content/themes/vip/plugins
|         |           |-> vip-init.php
|         |-> vp-theme (custom theme)
|-> mu-plugins
Vagrant URL: vagrant.local
Admin URL: vagrant.local/wp/wp-admin

安装上述两个后,我将机箱安装在/var/www/html/thevp文件夹中。这安装了一个名为wp的文件夹,我相信这是默认的 WordPress 安装。所以现在我有/var/www/html/thevp/wp(以及其他文件夹和文件)。
wp内容文件夹位于"wp"文件夹中

接下来,我从 svn co 安装了VIP 插件和助手https://vip-svn.wordpress.com/plugins/wp-content/themes/vip/plugins in/var/www/html/thevp/wp/wp-content/themes/vip/plugins

然后我在/var/www/html/thevp/wp/wp-content/mu-plugins里面安装了 VIP mu-插件

最后,我从Github克隆了我的VIP主题/var/www/html/thevp/wp/wp-content/themes/vp-theme

在所有安装和克隆之后,我从/var/www/html/thevp/中运行了$vagrant,它配置了我的机箱盒并显示 URL http://vagrant.local/。

上面的URL运行良好,并打开了带有TwentySeventeen主题的默认站点。 在"管理>主题"下,我可以看到我自己的主题 vp 主题以及 WordPress 已安装的其他默认主题。

但是每当我尝试激活此主题时,我都会收到此错误消息:

警告: require_once(/vagrant/content/themes/vip/plugins/vip-init.php):失败 打开流:没有这样的文件或目录/vagrant/wp/wp-content/themes/vip/yrc-wordpress-theme/functions.php on 第 9 行

致命错误:require_once():需要打开失败 '/vagrant/content/themes/vip/plugins/vip-init.php' (include_path='.:/usr/share/php') in/vagrant/wp/wp-content/themes/vip/yrc-wordpress-theme/functions.php on 第 9 行

假设/var/www/htm/thevp没有被识别为正确的路径,因为 wp-content 文件夹实际上驻留在/var/www/html/thevp/wp下,这应该是 root,我销毁了 VirtualBox 的运行实例并再次运行$ vagrant up但这次是从/var/www/html/thevp/wp内部。

但我仍然收到同样的错误。无法弄清楚如何解决此问题。

这是我第一次使用VIP主题。请帮忙!

更新:
我检查了主题的功能.php以下行

require_once WP_CONTENT_DIR . '/themes/vip/plugins/vip-init.php';

它在那里,但我有一种感觉,正如错误消息所说,WP_CONTENT_DIR可能由于某种原因输出了错误的路径

require_once(/vagrant/content/themes/vip/plugins/vip-init.php)...

我没有找到任何文件夹/vagrant/content.完全被困在这里,因为我不知道下一步该怎么做!

经过长时间的研究和谷歌搜索,我终于把它弄好了。

出现错误的主要原因是config.yaml file中定义的内容文件夹。

安装机箱时,它会在其根目录中创建一个名为config.yaml的文件。这是"路径">部分下文件中的默认设置。

# Base directory for reference. Relative to the Chassis directory.
base: .
# Where WordPress lives. Relative to the base directory.
wp: wp
# Content directory. Relative to the base directory.
content: content

我做的第一件事是content: content更改为content: wp/wp-content。这里要注意的是,底盘在"wp"下创建默认的WordPress安装,而不是在"Wordpress"下。

我需要更改的第二件事是在同一文件中从multisite: No更改为multisite: Yes

但是,在启动虚拟机时,我遇到了以下错误:

您的计算机似乎不支持 NFS,或者没有 用于在此计算机上为流浪者启用 NFS 的适配器

通过安装 NFS Common 和 NFS 内核服务器修复了此问题

$ sudo apt-get install nfs-common nfs-kernel-server

我在VitualBox使用vagrant启动期间遇到了另一个错误。它要求我输入sudo密码。但是提供后执行失败,我在控制台上收到以下消息:

以下 SSH 命令以非零退出状态响应。 流浪者认为这意味着命令失败!

mount -o 'vers=3,udp' 33.33.33.1:'/home/subrata/'/var/www

来自命令的 Stdout: 来自命令的 Stderr: stdin: 不是 tty mount.nfs:请求的 NFS 版本或传输协议不是 支持

为了解决这个问题,我必须在/etc/sudoers文件中添加以下行。

vagrant ALL=(ALL) NOPASSWD:ALL  
Defaults:vagrant !requiretty

终于我准备好了!$vagrant up已成功启动我的 VM。

http://vagrant.local 运行良好,现在我能够第一次激活自己的 VIP 主题:)

最新更新