Title: PHP errors
Last modified: October 1, 2016

---

# PHP errors

 *  Resolved [gduroy](https://wordpress.org/support/users/gduroy/)
 * (@gduroy)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/php-errors-87/)
 * Hi guys,
    I have to admit that your plugin seems awesome (considering the tests
   i did on local) but it’s causing a lot of PHP errors when i try to activate it
   on PROD:
 * Here is the error i got while trying to activate the plugin :
 * > Warning: Invalid argument supplied for foreach() in …/wp-content/plugins/sunshine-
   > photo-cart/addons/addon-manager/class-tgm-plugin-activation.php on line 2129
   > Warning: Cannot modify header information – headers already sent by (output
   > started at …/wp-content/plugins/sunshine-photo-cart/addons/addon-manager/class-
   > tgm-plugin-activation.php:2129) in …/wp-includes/pluggable.php on line 1174
 * And when activated, here is the warning i got on every page of the administration:
 * > Warning: Invalid argument supplied for foreach() in …/wp-content/plugins/sunshine-
   > photo-cart/addons/addon-manager/class-tgm-plugin-activation.php on line 2129
 * I’m using the theme LifeStyle and the plugins : Google Analytics for WordPress,
   Contact Form 7 and Master Slider.
 * Any idea of the reason of this warning ?
 * Any help would be much appreciated 🙂

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

 *  [Juliette Reinders Folmer](https://wordpress.org/support/users/jrf/)
 * (@jrf)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/php-errors-87/#post-8241979)
 * Hi [@gduroy](https://wordpress.org/support/users/gduroy/),
 * I’ve had a quick look and this is not an issue with the Sunshine Photo Cart plugin,
   but with your theme Lifestyle.
 * They are calling an external library used by both the plugin as well as the theme
   without the right arguments ($plugins variable has not been defined) and they
   should really fix this. /cc [@themehit](https://wordpress.org/support/users/themehit/)
   
   While they are at it, as they don’t currently use the external library, they 
   should either remove it and any code pointing to it òr, if they do intend to 
   use it, upgrade the version they include to the latest version (2.6.1).
 * In the mean time, you can solve the issue yourself:
    * Open up the `wp-themes/
   lifestyle/functions.php` file * Change line 161 from: `add_action( 'tgmpa_register','
   lifestyle_register_plugins' );` to `// add_action( 'tgmpa_register', 'lifestyle_register_plugins');`*
   Save the file (and if needed upload it to your server)
 * Hope this helps!
 * Smile,
    Juliette
 *  Thread Starter [gduroy](https://wordpress.org/support/users/gduroy/)
 * (@gduroy)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/php-errors-87/#post-8242102)
 * Works like a charm !
    Thanks a lot. I’ll notify the developers of the theme then
   😉 Thanks a lot for your help.

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

The topic ‘PHP errors’ is closed to new replies.

 * ![](https://ps.w.org/sunshine-photo-cart/assets/icon-256x256.png?rev=2963250)
 * [Sunshine Photo Cart - Client Photo Gallery & Photo Proofing for Photographers](https://wordpress.org/plugins/sunshine-photo-cart/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sunshine-photo-cart/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sunshine-photo-cart/)
 * [Active Topics](https://wordpress.org/support/plugin/sunshine-photo-cart/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sunshine-photo-cart/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sunshine-photo-cart/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [gduroy](https://wordpress.org/support/users/gduroy/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/php-errors-87/#post-8242102)
 * Status: resolved