• Resolved 3Lancer

    (@3lancer)


    Warning for those with older PHP versions attempting to upgrade this plugin to version 1.5, it might be disabled!

    The following message is displayed:

    Plugin could not be activated because it triggered a fatal error.

    Warning: require_once(__DIR__/inc/IM8qTranslateWooCommerce.php) [function.require-once]: failed to open stream: No such file or directory in …/wp-content/plugins/im8-qtranslate-woocommerce/im8-qtranslate-woocommerce.php on line 18

    Fatal error: require_once() [function.require]: Failed opening required ‘__DIR__/inc/IM8qTranslateWooCommerce.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in …/wp-content/plugins/im8-qtranslate-woocommerce/im8-qtranslate-woocommerce.php on line 18

    It appears you need PHP 5.3 to use (__DIR__) directory manipulation.

    I’m using PHP Version: 5.2.17 on my DEV Server for testing. This could cause major issues for those with older versions of PHP on their host server, so it is advice to check your PHP version before the update or adjust accordingly.

    On previous versions you may use dirname(__FILE__) instead.

    https://wordpress.org/plugins/im8-qtranslate-woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter 3Lancer

    (@3lancer)

    Quick fix for those using < PHP 5.3:

    Edit the file:
    im8-qtranslate-woocommerce/im8-qtranslate-woocommerce.php

    Location line 18:
    require_once __DIR__ . '/inc/IM8qTranslateWooCommerce.php';

    Replace it with:
    require_once dirname(__FILE__) . '/inc/IM8qTranslateWooCommerce.php';

    Then reactivate the plugin.

    Best Regards,

    3Lancer

    Plugin Contributor Thorsten Frommen

    (@ipm-frommen)

    Hi 3Lancer,

    thanks a lot for reporting this as well as providing the bugfix.

    Of course, I didn’t want to drop support of PHP versions prior to 5.3. Since I am developing a bunch of plugins for 5.3 right now, the magic constant __DIR__ was just something I missed when scanning the file for any functionality missing in PHP 5.2.X.

    However, I just released an update including your fix.

    Thanks again,
    Thorsten

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Version 1.5 fails reactivation (fatal error)’ is closed to new replies.