简体   繁体   English

将 kohana index.php 复制到子目录时,Kohana 3.0.8 出现 classes/kohana/core.php 问题

[英]Kohana 3.0.8 problem with classes/kohana/core.php when copying kohana index.php to subdir

I'm trying to do a dirty hack in order to set some php.ini variables for a specific part of my website.我正在尝试做一个肮脏的黑客攻击,以便为我网站的特定部分设置一些 php.ini 变量。

The hack is so that site wide the php.ini variables regarding POST sizes are the recommended PHP defaults.该 hack 使得站点范围内有关 POST 大小的 php.ini 变量是推荐的 PHP 默认值。 However in one area I am expecting a massive POST to be sent.然而,在一个领域,我期望发送大量的 POST。 This is for security reasons and so that people cant post massive objects everywhere and take up the sites RAM and processors etc.这是出于安全原因,因此人们不能到处张贴大量对象并占用站点 RAM 和处理器等。

Here's what I'm trying to do then:这就是我当时想做的事情:

  1. I have created a subdirectory in the public_html area called 'massiveupload' (the controller is also called this).我在 public_html 区域创建了一个名为“massiveupload”的子目录(controller 也称为这个)。

  2. In the folder I have place a .htaccess file which is the same as the default kohana one with a few differences (firstly RewriteBase is now /massiveupload and secondly RewriteRule is now RewriteRule.* index.php/projects/$0 [PT]).在文件夹中,我放置了一个 .htaccess 文件,它与默认的 kohana 文件相同,但有一些不同(首先,RewriteBase 现在是 /massiveupload,其次 RewriteRule 现在是 RewriteRule.* index.php/projects/$0 [PT])。 My php_values are also set here.我的 php_values 也设置在这里。

  3. Copied the index.php file and altered the system, application, and module paths so that they're correct.复制 index.php 文件并更改系统、应用程序和模块路径以使其正确。

Now... if I stick phpinfo() at the top of the index file I can see that the php_values are working when I visit http://www.mysite.com/massiveupload现在......如果我将 phpinfo() 粘贴在索引文件的顶部,我可以看到当我访问http://www.mysite.com/massiveupload时 php_values 正在工作

However when phpinfo() is taken out the website breaks at this line:然而,当 phpinfo() 被取出时,网站会在这一行中断:

require SYSPATH.'classes/kohana/core'.EXT;需要 SYSPATH.'classes/kohana/core'.EXT;

Which gives me a HTTP 500 (Internal Server Error).这给了我一个 HTTP 500(内部服务器错误)。

I have checked the path and the file exists, file_exists() can find it too.我检查了路径并且文件存在,file_exists() 也可以找到它。 So my guess would be that it's something within the file.所以我的猜测是它在文件中。

Any help would be greatly appreciated.任何帮助将不胜感激。

Having tried to debug the code further with the use of XDebug it wouldn't debug any further into the line that was causing the issue.尝试使用 XDebug 进一步调试代码后,它不会进一步调试导致问题的行。

I have instead implemented the solution a different way, setting specifc php_values in the VirtualHost part of HTTPD config... which can be found here: Kohana - controller specific .htaccess相反,我以不同的方式实现了解决方案,在 HTTPD 配置的 VirtualHost 部分中设置了特定的 php_values ......可以在这里找到: Kohana - controller 特定 .htaccess

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

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