We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3677
    • 130 Posts
    Here’s the first one:

    [2011-05-30 23:20:55] (ERROR @ /home/moaustin/public_html/core/cache/includes/elements/modplugin/1.include.cache.php : 7) PHP warning: include() [<a href=’function.include’>function.include</a>]: Failed opening ’/assets/plugins/gateway.php’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php’)


    <b>Strict Standards</b>: strftime() [<a href=’function.strftime’>function.strftime</a>]: It is not safe to rely on the system’s timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ’America/Chicago’ for ’CDT/-5.0/DST’ instead in <b>/home/moaustin/public_html/core/xpdo/xpdo.class.php</b> on line <b>1630</b>


    Now there is a plugin called "gateway" which contains this code:
    <?php
    include 'assets/plugins/gateway.php';


    The error seems to be related to including the external php file.
    The next error in the log is:

    [2011-05-30 23:21:10] (ERROR @ /home/moaustin/public_html/core/cache/includes/elements/modplugin/1.include.cache.php : 7) PHP warning: include() [<a href=’function.include’>function.include</a>]: Failed opening ’/assets/plugins/gateway.php’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php’)

    The thing is the gateway plugin seems to be working fine for me.
    How can I fix this?

    Thanks,
    -Brian
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Try referencing your gateway with the base path prepended, so that it has the actual complete absolute path. Think you can fetch that with $modx->getOption(’base_path’) or the MODX_BASE_PATH constant.

      I can imagine that when the plugin is ran on, for example, onHandleRequest it will be ran from the index.php file and it will work - but as soon as it hits the cache the relative path points to a different location... if tha tmakes sense.


      As for the other error, it tells you possible solutions..
      Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function.


      Have a look at your hosts support center to see which one they advise, perhaps there’s an option in your control panel even.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 3677
        • 130 Posts
        Mark,

        Thanks for the advice. My web host was able to update a global php.ini file and add the date.timezone setting for me. I also changed the include path to use base_path like you suggested.

        Thanks,
        -Brian