Title: php errors (non-compatable,static functions,variables) on NextGen
Last modified: August 21, 2016

---

# php errors (non-compatable,static functions,variables) on NextGen

 *  [Matt Bagley](https://wordpress.org/support/users/mydigitalwalk/)
 * (@mydigitalwalk)
 * [12 years ago](https://wordpress.org/support/topic/php-errors-non-compatable-classesstatic-functionsvariables-on-nextgen/)
 * Just a bunch of recurrent errors I have seen in my logs. I have verion 2.0.66
   The plugin appears to be working fine, so these are prob warnings. But warnings
   still slow things down… Using php 5.4
 *     ```
       Only variables should be passed by reference
       /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_controller.php(40)
   
       -----------------------
   
       Non-static method M_Lightbox::_add_script_data() should not be called statically
       /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/module.lightbox.php(171)
   
       -----------------------
   
       Declaration of C_DataMapper_Driver_Base::define() should be compatible with C_Component::define($context = false)
       /wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php(939)	
   
       Declaration of C_DataMapper_Driver_Base::define() should be compatible with C_Component::define($context = false)
       /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_driver_base.php(741)
   
       Declaration of C_DataMapper_Model::__set() should be compatible with & ExtensibleObject::__set($property, $value)
       /wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php(939)
   
       Declaration of C_DataMapper_Model::__set() should be compatible with & ExtensibleObject::__set($property, $value)
       /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_model.php(135)
   
       Declaration of C_Gallery_Storage::define() should be compatible with C_Component::define($context = false)
       /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallery_storage.php(43)
   
       Declaration of C_GalleryStorage_Driver_Base::define() should be compatible with C_Component::define($context = false)
       /wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php(939)
   
       Declaration of C_GalleryStorage_Driver_Base::define() should be compatible with C_Component::define($context = false)
       /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php(1501)
   
       Declaration of C_Lightbox_Library_Mapper::define() should be compatible with C_Component::define($context = false)
       /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/class.lightbox_library_mapper.php(45)
   
       Declaration of C_Lightbox_Library_Mapper::define() should be compatible with C_Component::define($context = false)
       /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/class.lightbox_library_mapper.php(7)
   
       Declaration of C_MVC_View::define() should be compatible with C_Component::define($context = false)
       /wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php(939)
   
       Declaration of C_MVC_View::define() should be compatible with C_Component::define($context = false)
       /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_view.php(30)
   
       Declaration of C_MVC_View::initialize() should be compatible with C_Component::initialize()
       /wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php(939)
   
       Declaration of C_MVC_View::initialize() should be compatible with C_Component::initialize()
       /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/class.mvc_view.php(30)
       ```
   
 * [https://wordpress.org/plugins/nextgen-gallery/](https://wordpress.org/plugins/nextgen-gallery/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years ago](https://wordpress.org/support/topic/php-errors-non-compatable-classesstatic-functionsvariables-on-nextgen/#post-4963570)
 * [@matt](https://wordpress.org/support/users/matt/) Bagley – I’m not seeing these
   error messages in my PHP 5.4 test installation, do you have any other details
   that might point to what was happening with these messages were being written?
 * – Cais.
 *  Thread Starter [Matt Bagley](https://wordpress.org/support/users/mydigitalwalk/)
 * (@mydigitalwalk)
 * [12 years ago](https://wordpress.org/support/topic/php-errors-non-compatable-classesstatic-functionsvariables-on-nextgen/#post-4963620)
 * I believe they are all strict errors (or notices?). I have a plugin that catches
   all the errors and shows them.
 * And then I have this little plugin that makes it show them. Without it, it only
   shows really bad errors.
 *     ```
       <?php
       /*
       Plugin Name: Show Strict Errors
       Plugin URI: http://www.mydigitalwalk.com
       Description: Funny little plugin that will display all site errors. Careful...
       Version: 0.1
       Author: Matt Bagley
       Author URI: http://www.mydigitalwalk.com
       License: GPLv2 or later
       */
   
       error_reporting(E_ALL);
       //use with an error catcher, or just to display
       ini_set('display_errors', '1');
       //otherwise keep a log. may get really long really fast...
       //ini_set('log_errors','true');
       //ini_set('error_log','/path/to/error_log');
       //ini_set('error_reporting','999999999');
   
       ?>
       ```
   
 * Anyhow, some of the errors are simple. Like the non-static function in module.
   lightbox.php. It’s being called as $this->_add_script_data on one line and then
   as self::_add_script_data in another place.
 * The error is referencing the second call. Either call it as $this->_add_script_data
   or set the function to “public static” and call both as self::_add_script_data.
 * Don’t know about the “should be compatible with” errors. It’s complaining about
   the same call/function/method for each pair. Might be something in the extending
   the original class. I noticed lots of them don’t like or are clashing with C_Component::
   define.
 * Let me know if the above plugin helps. Oh, and you can’t just put it in wp-config.
   php. For some reason (atleast for me) WordPress messes with it later on and nothing
   shows.
 * Otherwise I’ll see how to get them to show on a default install.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years ago](https://wordpress.org/support/topic/php-errors-non-compatable-classesstatic-functionsvariables-on-nextgen/#post-4963661)
 * [@matt](https://wordpress.org/support/users/matt/) Bagley – If you do not use
   the “Show Strict Errors” plugin are you still seeing these logs being written
   to?
 * – Cais.
 *  Thread Starter [Matt Bagley](https://wordpress.org/support/users/mydigitalwalk/)
 * (@mydigitalwalk)
 * [12 years ago](https://wordpress.org/support/topic/php-errors-non-compatable-classesstatic-functionsvariables-on-nextgen/#post-4963664)
 * No. They don’t seem to.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years ago](https://wordpress.org/support/topic/php-errors-non-compatable-classesstatic-functionsvariables-on-nextgen/#post-4963672)
 * [@matt](https://wordpress.org/support/users/matt/) Bagley – Thanks for the update.
   In most cases these messages are not going to be an issue for most servers as
   the error level reporting settings are generally not high enough to trip over
   these messages.
 * As it is, we do try to eliminate those that we find but they also should not 
   be affecting any of NextGEN Gallery’s functionality.
 * – Cais.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘php errors (non-compatable,static functions,variables) on NextGen’ is
closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

 * [PHP errors](https://wordpress.org/support/topic-tag/php-errors/)

 * 5 replies
 * 2 participants
 * Last reply from: [photocrati](https://wordpress.org/support/users/photocrati/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/php-errors-non-compatable-classesstatic-functionsvariables-on-nextgen/#post-4963672)
 * Status: not resolved