-
☆ A M B ☆
- 70 Posts
This Issue seems not belong to a corrupted file. It seems to be caused by APC.
With APC enabled this error comes back. Disabling APC and running the setup again seems to fix it. But disabling APC can't be a solution...
This issue belongs to this issue in the tracker:
http://tracker.modx.com/issues/6695
We don't have APC on our server, so we cannot disable it. After upgrading quite recently, now we cannot access the manager any longer it outputs an 500 error.
hi everybody,
I have the same error in my php logs, have you an idea for fix this problem ?
ERROR : mod_fcgid: stderr: PHP Catchable fatal error: Argument 1 passed to xPDOObject::load() must be an instance of xPDO, instance of modX given in /path/to/my/vhost/core/xpdo/om/xpdoobject.class.php on line 404
MODX-Version: MODX Revolution 2.2.6-pl (traditional)
PHP: 5.3.19
APC is enabled
I need to keep APC activated because I use APC cache for my websites modx
-
MODX Staff
- 10,725 Posts
Disabling APC may get rid of the error, but it is NOT a solution. This occurs when a script attempts to write to the session after a die() or exit() has been executed. All scripts in MODX should call session_write_close() before calling an exit() or die(). Failure to do so can result in this error on certain configurations. Though, unless it really is writing session data, the error is fairly harmless, unless you have display_errors enabled in your PHP configuration.
There were some min-related issues pre-2.2.6 that triggered this error, but those should be resolved. If not please report what is triggering this error if you can figure it out. Also, look for component or custom scripts that might be calling exit() or die().
Thanks for your reply opengeek.
I'll look at the different extra installed when I have a moment.
Since the error is not important, it relieves me.
thank you again
-
☆ A M B ☆
- 339 Posts
A new site of mine has exacly this error message in the webservers error log.
I have a failing custom snippet which I planned to setup to display tooltips. As I am new to snippets, I dont know whats wrong. But it might lead you to whats wrong.
This is the call:
<code>[[!tooltip? &term=`test` &explain=`some Text` ]]</code>
And this is the snippet in some "debug" state:
<code>$term = $scriptProperties['term'];
$explain = $scriptProperties['explain'];
if (empty($term)) {
$modx->log(modX::LOG_LEVEL_DEBUG,'[tooltip] Empty term passed, aborting.');
return '';
}
elseif (empty($explain)) {
$modx->log(modX::LOG_LEVEL_DEBUG,'[tooltip] Empty explaination passed, aborting.');
return '';
}
else {
// Set placeholders:
$modx->setPlaceholder('term', $term));
$modx->setPlaceholder('explain', $explain));
return $modx->getChunk('tooltip');
}</code>
-
☆ A M B ☆
- 70 Posts
<?php
header("Content-Type: text/plain; charset=utf-8");
ini_set('display_errors',1);
require 'config.core.php');
require MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = modX::getInstance();
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
return "";
?>
When I run the code snippet from above in an external php file, I'll always get
Catchable fatal error: Argument 1 passed to xPDOObject::load() must be an instance of xPDO, instance of modX given in /paas/c0xxx/www/core/xpdo/om/xpdoobject.class.php on line 404
This shouldn't happen or am I missing something?
-
☆ A M B ☆
- 70 Posts
Quote from: opengeek at Mar 28, 2013, 09:52 AMYes, if you are using the default database session handler configured with MODX, and the script is going to be run from the web (not CLI), you need to close the session before exiting, e.g.
Thanks Jason. That fixed it and makes sense. But yes, this script will be a cronjob (not started via CLI, due restriction from the hosting company) - so it doesn't need any sessions. What's the best way to handle that? Setting 'MODX_API_MODE' to true?
-
MODX Staff
- 10,725 Posts
In CLI mode (or a cronjob, same thing) there are no sessions, so it should only be an issue when running this through a browser.