简体   繁体   English

PHP Kohana包含问题

[英]PHP Kohana include problem

I am dealing with a very strange and rather simple problem about 2 days now. 我现在要处理大约2天的一个非常奇怪且相当简单的问题。 I bet the solutions is obvious but i just dont know what else to do. 我敢打赌解决方案很明显,但是我不知道该怎么办。

I am working in Kohana framework. 我在Kohana框架中工作。 In my C:/wamp/www folder i have two different sites: mysite1 and mysite2. 在我的C:/ wamp / www文件夹中,我有两个不同的站点:mysite1和mysite2。

So i have the fckeditor working in the mysite1 site included like this: 所以我让fckeditor在mysite1网站上工作,如下所示:

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

and works like a charm! 就像魅力一样!

Well i decided to incorporate fckeditor in mysite2, and i use the very same command.. and it just does not work and there is an erro message: 好吧,我决定将fckeditor合并到mysite2中,并且我使用相同的命令..却不起作用,并出现一条错误消息:

no such file or directory.. 没有相应的文件和目录..

I assure you that fckeditor exists in 我向您保证fckeditor存在于

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

The full path (C:/wamp/www/mysite2/web/admin/static/scripts/fckeditor/fckeditor.php ) path include works. 完整路径(C:/wamp/www/mysite2/web/admin/static/scripts/fckeditor/fckeditor.php)包含了作品。 I just want to get include(url::base(FALSE)."static/scripts/fckeditor/fckeditor.php") working... 我只想让include(url :: base(FALSE)。“ static / scripts / fckeditor / fckeditor.php”)工作...

What could possibly be wrong?? 有什么可能是错的吗?

Thanks! 谢谢!

When you need to include files, you can use find_file() method. 当需要包含文件时,可以使用find_file()方法。 So, your code will looks like 因此,您的代码看起来像

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

If the full path works fine, but the path using the url helper doesn't work, it's probably a site configuration error. 如果完整路径可以正常工作,但使用url helper的路径不起作用,则可能是网站配置错误。

Do any of your includes using url::base work? 您使用url::base任何url::base工作吗?

Looking at the output of your page, what does url::base(FALSE)."static/scripts/fckeditor/fckeditor.php" evaluate to? 查看页面的输出, url::base(FALSE)."static/scripts/fckeditor/fckeditor.php"计算结果是什么?

Take a look at config.php, make sure your site_domain is set up properly. 看一下config.php,确保正确设置了site_domain。

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

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