We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42737
    • 16 Posts
    Hi guys, first some technical details:

    Modx: 2.1.5-pl
    apache: 2
    php: 5.2.17
    mysql: 5.5.9
    zend framework: 1.11.11

    I've been tasked with maintaining a website that was built a couple years ago using a custom helper called ModSync:

    https://github.com/rzak/ModSync

    At the moment, I am just trying to set up a local install of this modx site. I've copied files over, followed the many guides available, run setup successfully, and confirmed my steps many times over.

    When I try to load the home page, or submit login credentials, I receive a fatal error along the lines of this:

    Fatal error: Class 'ModSync_Plugin_ModSync' not found in...

    With some long hours spent troubleshooting I've been able to determine (I think) that Zend Framework is a dependency which doesn't seem to be loading properly.

    ModSync_Plugin extends an abstract class, which extends, implements, and otherwise relies on other modsync stuff, and the point of failure seems to be when it attempts to instantiate Zend_Log.

    But I'm unable to determine why Zend Framework classes aren't found. My php.ini file includes the correct path to the library folder containing the Zend directory, and in my file auto_prepend.php I have:

    require_once 'Zend/Loader/Autoloader.php';
    $autoloader = Zend_Loader_Autoloader::getInstance();
    $autoloader->registerNamespace('ModSync_');

    However this doesn't seem to be making Zend available to the rest of this modx application. If I insert this code in to the front end context index.php file, for example, I can instantiate a Zend object successfully.

    Sorry, in advance for the length of this message, but I'm not sure what information is necessary in order to troubleshoot this problem. Any advice you folks can offer would be very much appreciated.
      • 3749
      • 24,544 Posts
      You might try putting that code in a plugin attached to whatever events the modSync plugin is attached to.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 42737
        • 16 Posts
        Turned out that modsync was being included using php_value auto_prepend_file in the vhost.conf file for this particular domain!