我的 Kohana 环境已设置在我的 webroot 路径上,我需要将其移动到我的应用程序中。目前深度为三 (3) 层。当我访问 Kohana 网站时,它说它不再存在。它返回“未找到对象”。
是否可以将 Kohana base_url
重命名为其他名称,而不会使整个系统崩溃?如果是,我需要修改哪些文件?
我的 Web 服务器中有两个 Kohana 安装:
- 第一个安装路径 -
http://localhost/kohana/
- 第二个安装路径 -
http://localhost/haz/system/framework/< /code>
其中 framework 是我的 Kohana,第一次安装工作完美。
第二个我在 bootstrap (base_url)
中进行了修改,并添加了完整的 URL:http://localhost/haz/system/framework/ 来访问它。
当我尝试通过浏览器访问时,我只能访问欢迎页面,但其余部分来自第一次安装。
例如,我有一个名为客户的(控制器/模型/视图)。当我尝试访问客户时,它显示第一次安装的客户,而不是预期的第二个安装。
我认为还有一些其他文件需要与 bootstrap 中的 path 一起修改,因为带有完整 URL 的 base_url
没有解决问题。
或者 Kohana 不接受在同一 Web 服务器中进行两次安装。
原始 PHP 对我来说更容易、更快,但重复让我很头疼,所以我尝试使用 Kohana 框架。如果它让我更头疼,我想我会坚持使用原始 PHP。
My Kohana enviroment is setup already on my webroot path, and I need to move it inside my application. It is currently three (3) levels deep. When I access my Kohana site it says it does not exists anymore. It returns "Object not found".
Is it possible to rename Kohana base_url
to something else, without crashing the whole system? If yes, which files do I need to modify?
I have two installations of Kohana in my web server:
- First installation path -
http://localhost/kohana/
- Second installation path -
http://localhost/haz/system/framework/
Where framework is my Kohana, the first installation works perfectly.
The second one I did the modifications in the bootstrap (base_url)
and added the full URL: http://localhost/haz/system/framework/ to access it.
When I try to access via the browser I can only access the welcome page but the rest comes from the first installation.
For example, I have a (controller/model/view) called Customers. When I try to access the customers, it shows up the customers of the first installation and not the second as expected.
I think there are some other files that I do need to modify along with the path in bootstrap, because the base_url
with the full URL did not fix the problem.
Either that or Kohana doesn't accept two installations in the same web server.
Raw PHP is much easier and faster for me, but repetition is giving a lot of headache, so I'm trying to use the Kohana framework. If it gives me more headaches I think I'll stick to raw PHP.
发布评论
评论(1)
在
application/bootstrap.php
中打开引导文件,然后搜索行Kohana::init
。该函数的参数之一应该是基本 URL,因此您可以在此处将其更改为您想要的任何内容。如果尚未设置(不太可能),您可以手动添加它:编辑:
在不查看详细信息的情况下,是否有任何原因将框架文件放在不同的位置?总的来说,Kohana 足够轻量级,因此您可以将整个框架与每个应用程序放在一起。
另外,当您谈论 Kohana 的安装时,您指的是
system
和modules
文件夹还是所有 Kohana 文件(包括application
)。如果是后者,则说明您的配置有问题,因为application
文件夹显然无法由不同的应用程序共享。如果可以的话,尝试将整个 Kohana 框架移动到应用程序文件夹旁边,使用正常的应用程序/模块/系统文件夹结构,然后调整配置。
Open your bootstrap file in
application/bootstrap.php
then search for the lineKohana::init
. One of the parameters of this function, should be the base URL, so you can change it here to whatever you want. If it's not already set (unlikely), you can add it manually:Edit:
Without looking into the details, is there any reason why you have the framework's file in a different location? In general, Kohana is lightweight enough so that you can put the whole framework with each application.
Also, when you talk about a Kohana's installation, do you mean the
system
andmodules
folders or all of the Kohana files (includingapplication
). If it's the latter, there is something wrong with your configuration because theapplication
folder obviously cannot be shared by different applications.If you can, try to move the whole Kohana framework next to your application folder, with the normal application/modules/system folder structure, then tweak the configuration.