• Resolved jkf1

    (@jkf1)


    Hello,

    I am preparing to update my php (currently 5.2.17) to at least 5.3 and I was hoping to use this plugin. It is installed. When I try to activate it, I get the following error (/s).

    Warning: require_once(__DIR__/vendor/autoload.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/02/8938802/html/wp-content/plugins/php-compatibility-checker/wpengine-phpcompat.php on line 15

    Fatal error: require_once() [function.require]: Failed opening required ‘__DIR__/vendor/autoload.php’ (include_path=’/home/content/02/8938802/html/wp-content/plugins/google/lib/external/google:.:/usr/local/php5/lib/php’) in /home/content/02/8938802/html/wp-content/plugins/php-compatibility-checker/wpengine-phpcompat.php on line 15

    Any help is appreciated.

    My organizations website is https://www.jackkempfoundation.org using wordpress 4.7.

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Jason Stallings

    (@octalmage)

    Hi @jkf1,

    Unfortunately since __DIR__ was added in PHP 5.3, it looks like the plugin in it’s current state won’t work with PHP 5.2.

    If you would like to get the plugin to work, you could try replacing all instances of __DIR__ with dirname( __FILE__ ). Although I’m not 100% sure if the dependencies support 5.2.

    Hi @octalmage,

    If the plugin doesn’t work 100% in PHP 5.2, I’d recommend adding a minimum requirements section to your plugin docs that state this, and then have the plugin detect PHP version upon activation, and automatically deactivate if PHP is < 5.3.

    @octalmage & @jkf1:
    If you want the plugin to work on 5.2, then you just need to add one line of code towards the beginning of the plugin…something like this:

    
    if ( !defined( '__DIR__' ) ) { define( '__DIR__', dirname( __FILE__ ) ); }
    

    That’s a lot simpler then asking a user to search & replace all instances of __DIR__.

    – Scott

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fatal error on plugin activation’ is closed to new replies.