doumi1884 2013-12-05 05:13
浏览 57
已采纳

为什么Joomla! 崩溃PHP?

I'm working with a customised Joomla! 2.5.8 app, and I'm stepping through the code in Eclipse. The code I'm stepping through is in myapp/libraries/joomla/plugin/helper.php, and is in the JPluginHelper::_import function. The code in question looks like this:

if ($pathExists || file_exists($legacypath))
{
    $path = $pathExists ? $path : $legacypath;
    if (!isset($paths[$path]))
    {
        require_once $path;
    }
    $paths[$path] = true;

The problem code is the require_once line. The $path variable contains the name of a file on my system, and I've put breakpoints and logging inside the file before anything else happens, but that code is never executed, and the breakpoint is never hit.

The call stack before that line looks like this:

myapp/libraries/joomla/plugin/helper.php.JPluginHelper::_import() : lineno 171
myapp/libraries/joomla/plugin/helper.php.JPluginHelper::importPlugin() : lineno 125
myapp/components/com_content/views/article/view.html.php.ContentViewArticle->display() : lineno 123
myapp/libraries/joomla/application/component/controller.php.JController->display() : lineno 722
myapp/components/com_content/controller.php.ContentController->display() : lineno 74
myapp/libraries/joomla/application/component/controller.php.JController->execute() : lineno 761
myapp/components/com_content/content.php.require_once() : lineno 16
myapp/libraries/joomla/application/component/helper.php.JComponentHelper::executeComponent() : lineno 383
myapp/libraries/joomla/application/component/helper.php.JComponentHelper::renderComponent() : lineno 351
myapp/includes/application.php.JSite->dispatch() : lineno 197
myapp/index.php.{main}() : lineno 44

Then when I attempt to step into the require_once bit, the call stack looks like this:

myapp/libraries/joomla/session/storage/database.php.JSessionStorageDatabase->write() : lineno 71
myapp/libraries/joomla/session/storage/database.php.JPluginHelper::_import() : lineno 0
myapp/libraries/joomla/plugin/helper.php.JPluginHelper::importPlugin() : lineno 125
myapp/components/com_content/views/article/view.html.php.ContentViewArticle->display() : lineno 123
myapp/libraries/joomla/application/component/controller.php.JController->display() : lineno 722
myapp/components/com_content/controller.php.ContentController->display() : lineno 74
myapp/libraries/joomla/application/component/controller.php.JController->execute() : lineno 761
myapp/components/com_content/content.php.require_once() : lineno 16
myapp/libraries/joomla/application/component/helper.php.JComponentHelper::executeComponent() : lineno 383
myapp/libraries/joomla/application/component/helper.php.JComponentHelper::renderComponent() : lineno 351
myapp/includes/application.php.JSite->dispatch() : lineno 197
myapp/index.php.{main}() : lineno 44

To make it really clear, the myapp/libraries/joomla/plugin/helper.php.JPluginHelper::_import() frame is replaced by myapp/libraries/joomla/session/storage/database.php.JPluginHelper::_import(). PHP gives up and provides no logging at all. I cannot see anything of the site itself.

I'm on Ubuntu, using Apache2, PHP5 and XDebug. It doesn't matter whether or not XDebug is active.

Has anyone encountered this sort of thing before? I don't really want to go back to a standard Joomla! install, and gradually re-import modules, but if that's what I gotta do ...

  • 写回答

1条回答 默认 最新

  • dongqiang1894 2013-12-05 05:57
    关注

    I think this is because of :

    ==> Database contains an entry for a plugin and files for that plugin does not exists, when joomla goes to require those files then found cannot find any file for that plugin.

    What you can do:

    ==> You have to go to the line where joomla requires files (as you have mentioned above "JPluginHelper::_import") and then Print the path. By doing this you will see all required paths(in browser) and last path you will see the path which is rising error.

    ====> Check that file exists or not.

    ====> Now find entry for that plugin in extensions table and set published to '0'.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 关于#html5#的问题:H5页面用户手机返回的时候跳转到指定页面例如(语言-javascript)
  • ¥15 无法使用此凭据登录,因为你的域不可用,如何解决?(标签-Windows)
  • ¥15 yolov9的训练时间
  • ¥15 二叉树遍历没有报错但无法正常运行
  • ¥15 在linux系统下vscode运行robocup3d上场球员报错
  • ¥15 Python语言实验
  • ¥15 SAP HANA SQL 增加合计行
  • ¥20 用C#语言解决一个英文打字练习器,有偿
  • ¥15 srs-sip外部服务 webrtc支持H265格式
  • ¥15 在使用abaqus软件中,继承到assembly里的surfaces怎么使用python批量调动