Apache错误 - 子pid 1789退出信号总线错误(10)

时间:2012-01-11 23:20:40

标签: php apache fuelphp

我得到了这个奇怪的错误child pid 1789 exit signal Bus error (10)我在Apache错误日志中从未见过。我正在使用FuelPHP框架。网络应用程序运行正常。但突然间我今天创建了新的控制器,它本身就是另一个控制器的副本。我复制的那个工作正常(http:// localhost / myapp / admin / users),但副本(http:// localhost / myapp / admin / apartments)让我出错了?!我对此感到沮丧。

经过3个小时的调试后,我终于找到了整个停止的路线。它位于此行if (class_exists($class))的Router类的FuelPHP核心中。 if之前的$class有值Controller_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 forum中的用户注意到这可能与硬件有关。但事实并非如此。我把整个东西搬到另一台电脑上,但仍然有同样的事情。我只是不明白。这里发生了什么?

2 个答案:

答案 0 :(得分:1)

好的拍我。刚发现错误我自己。我不知道为什么会发生但我的控制器Controller_Admin_Apartments中有一个synthax错误。我有这个功能:

public function action_delete($id = null)
{
    if (apartment = Model_Apartment::find($id))
    {
        $apartment->delete();
        Session::set_flash('success', 'Deleted apartment #'.$id);
    }
    else
    {
        Session::set_flash('error', 'Could not delete apartment #'.$id);
    }
    Response::redirect('admin/apartments');
}

请注意以下行:if (apartment = Model_Apartment::find($id)),我忘了在变量名前面添加$。我真的很惊讶FulePHP框架没有在此提醒我,我唯一的错误是在Apache错误日志中:S。奇怪,只是奇怪......

答案 1 :(得分:0)

这是一个完全不同的解决方案,但与'信号总线错误'有关:当我在php.ini的memory_limit设置中意外输入512MB而不仅仅是512M时,我得到了这个。 / p>