[英]WordPress: Fatal error with no additional information thrown upon plugin activation
I'm building a plugin at the moment. 我正在构建一个插件。 In the "index"-page (the one with the information about the plugin) I use
require_once
. 在“索引”页面(包含有关插件信息的页面)中,我使用
require_once
。 When I want to activate the plugin, a fatal error is thrown: 当我想激活插件时,会引发致命错误:
Plugin could not be activated because it triggered a fatal error.
No more information is shown. 没有显示更多信息。
I commented all the lines except require_once plugins_url('php/hooks.php', __FILE__);
我注释了所有行,但
require_once plugins_url('php/hooks.php', __FILE__);
out and checked the path. 出来并检查路径。 Still triggering a fatal error.
仍会触发致命错误。 The problem has to be the
require_once
command but I don't know what to do about it. 问题必须是
require_once
命令,但我不知道该怎么办。 I have used this command in the exact same context, file and version of WordPress before and it worked back then. 我以前在完全相同的WordPress上下文,文件和版本中使用过此命令,而当时它可以正常工作。
Problem solved. 问题解决了。
require_once
needs a path, not an URL. require_once
需要路径,而不是URL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.