繁体   English   中英

PHP Kohana包含问题

[英]PHP Kohana include problem

我现在要处理大约2天的一个非常奇怪且相当简单的问题。 我敢打赌解决方案很明显,但是我不知道该怎么办。

我在Kohana框架中工作。 在我的C:/ wamp / www文件夹中,我有两个不同的站点:mysite1和mysite2。

所以我让fckeditor在mysite1网站上工作,如下所示:

include(url::base(FALSE)."static/scripts/fckeditor/fckeditor.php"); -> include(mysite/web/admin/static/scripts/fckeditor/fckeditor.php)

就像魅力一样!

好吧,我决定将fckeditor合并到mysite2中,并且我使用相同的命令..却不起作用,并出现一条错误消息:

没有相应的文件和目录..

我向您保证fckeditor存在于

mysite2/web/admin/static/scripts/fckeditor/fckeditor.php

完整路径(C:/wamp/www/mysite2/web/admin/static/scripts/fckeditor/fckeditor.php)包含了作品。 我只想让include(url :: base(FALSE)。“ static / scripts / fckeditor / fckeditor.php”)工作...

有什么可能是错的吗?

谢谢!

当需要包含文件时,可以使用find_file()方法。 因此,您的代码看起来像

include Kohana::find_files("static", "/scripts/fckeditor/fckeditor");

如果完整路径可以正常工作,但使用url helper的路径不起作用,则可能是网站配置错误。

您使用url::base任何url::base工作吗?

查看页面的输出, url::base(FALSE)."static/scripts/fckeditor/fckeditor.php"计算结果是什么?

看一下config.php,确保正确设置了site_domain。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM