We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39587
    • 59 Posts
    I have been using MODX for sometime know and installation has always been straight forward.

    -Download package from modx website
    -Upload to server
    -Extract to directory
    -Create blank database with user and password
    -Start setup by entering path to the setup directory (eg example.com/setup)

    I had to pull down all the sites that I build on modx after being attacked by hackers and decided to do a fresh installation of the latest version of modx.

    After following the usual steps I got the "Your MODX_CORE_PATH is invalid" message.

    Aft6er entering the path to the core directory (which I also renamed and relocated to the webroot) I got the following errror:


    Warning: include() [function.include]: Failed opening '__DIR__/bootstrap.php' for inclusion (include_path='.:/usr/lib64/php:/usr/share/pear') in /home2/user/public_html/core_xxx/model/smarty/Smarty.class.php on line 72

    Fatal error: Class 'Smarty_Template_Compiled' not found in /home2/user/public_html/core_xxx/model/smarty/sysplugins/smarty_internal_template.php on line 554


    How do I fix this? NB:- I do not intend to use bootstrap or any other fancy stuff just basic html and css.

    Thanks

    This question has been answered by sheils. See the first response.

      • 46886
      • 1,154 Posts
      I feel that your paths might not be right but the error indicates otherwise...this bootstrap is probably just to frame your manager page and make it re-sizable.

      Do you have the smarty folder in your core? Could it be a permissions problem?

      What's this it looks weird to me

      (include_path='.:/usr/lib64/php:/usr/share/pear')
        • 39587
        • 59 Posts
        Yes there is a smarty folder and the code on line 73 of Smarty.class.php is:-

            include __DIR__ . '/bootstrap.php';


        Line 554 of /home2/user/public_html/core_xxx/model/smarty/sysplugins/smarty_internal_template.php is:-

        $this->compiled = Smarty_Template_Compiled::load($this);



        Smarty_Template_Compiled exist in the same folder but in different case:-

        smarty_template_compiled.php

        Noting that php is case sensititive this may very well be the source of the error. What do you guys think.


        I don't know what
        include_path='.:/usr/lib64/php:/usr/share/pear'
        is but looks like it is generated from
        __DIR__


        I did a little googling and found that:

        You can use __DIR__ to get your current script's directory. It has been in PHP only since version 5.3

        My host is running 5.4.24 so that should be fine.

        Just done some test by inserting the following lines at the start of the code:-

         echo __DIR__."<br>";
         echo __FILE__;


        Output is:

        __DIR__
        /home2/xxx/public_html/core_xxx/model/smarty/Smarty.class.php

        So looks like __DIR__ is not working as intended. [ed. note: sheils last edited this post 5 years, 8 months ago.]
          • 46886
          • 1,154 Posts
          Its got to be permissions I think, the file is there it doesn't see it
          • discuss.answer
            • 39587
            • 59 Posts
            Looks like have fixed the problem.

            Replace __DIR__ with dirname(__FILE__) is the fix.

            Sounds like a bug that require reporting
              • 46886
              • 1,154 Posts
              Wow really! Great detective work!
              • Looks like that something weird with PHP version. Could you try this code?

                echo phpversion() . "<br>";
                echo __DIR__."<br>";
                echo __FILE__;
                  Alroniks experts
                  MODX Ambassador | MODX Professional

                  alroniks.com | [email protected] | +375 33 638 10 92 (Belarus)
                  Facebook | Twitter | VK.com
                  • 39587
                  • 59 Posts
                  Hi Ivan, I run your code from the bootstrap.php file and got this:

                  5.2.17
                  __DIR__
                  /home2/xxx/public_html/xxx/core/model/smarty/bootstrap.php

                  So looks like my host is not providing the version listed in control panel(see attachment)

                  Cheers
                    • 39587
                    • 59 Posts
                    Just had a chat with my host and changed the php version that my website is running on to 5.6 and
                    _DIR_
                    now runs