child pid 1789 exit signal Bus error (10)
我在我的 Apache 错误日志中遇到了这个我以前从未见过的奇怪错误。我正在使用 FuelPHP 框架。网络应用程序运行良好。但是今天突然间我创建了新的控制器,它本身就是另一个控制器的副本。我复制的那个工作正常(http://localhost/myapp/admin/users),但是副本(http://localhost/myapp/admin/apartments)让我犯了那个错误?!我对此感到沮丧。
经过3个小时的调试,我终于找到了整个事情停止的那一行。它在这一行的 Router 类的 FuelPHP 核心中if (class_exists($class))
。if 之前的$class
valueController_Admin_Apartments
是我添加的类,并且存在于我的控制器类文件夹中。
燃料/核心/类/router.php:
protected static function parse_segments($segments, $namespace = '', $module = false)
{
$temp_segments = $segments;
foreach (array_reverse($segments, true) as $key => $segment)
{
$class = $namespace.'Controller_'.\Inflector::words_to_upper(implode('_', $temp_segments));
array_pop($temp_segments);
if (class_exists($class)) // ***** HERE ERROR HAPPENS ***** //
{
return array(
'controller' => $class,
'action' => isset($segments[$key + 1]) ? $segments[$key + 1] : null,
'method_params' => array_slice($segments, $key + 2),
);
}
}
// Fall back for default module controllers
if ($module)
{
$class = $namespace.'Controller_'.$module;
if (class_exists($class))
{
return array(
'controller' => $class,
'action' => isset($segments[0]) ? $segments[0] : null,
'method_params' => array_slice($segments, 1),
);
}
}
return false;
}
FeulPHP 论坛的一位用户指出,这可能与硬件有关。但事实并非如此。我把整个东西移到另一台电脑上,仍然有同样的东西。我只是不明白。这里发生了什么?