Title: Something wrong. Invalid argument and cannot modify header
Last modified: August 20, 2016

---

# Something wrong. Invalid argument and cannot modify header

 *  Resolved [flamenko](https://wordpress.org/support/users/flamenko/)
 * (@flamenko)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/something-wrong-invalid-argument-and-cannot-modify-header/)
 * Can someone help me with this? This is what is happening when I try to compress
   an image.
 * Warning: Invalid argument supplied for foreach() in /home/XXXXX/public_html/wp-
   content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 1096
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/XXXXX/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-
   optimizer.php:1096) in /home/thessd5/public_html/wp-includes/pluggable.php on
   line 881
 * [http://wordpress.org/extend/plugins/ewww-image-optimizer/](http://wordpress.org/extend/plugins/ewww-image-optimizer/)

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

 *  Plugin Author [nosilver4u](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/something-wrong-invalid-argument-and-cannot-modify-header/#post-3172492)
 * Just to be clear, you clicked the ‘optimize’ link next to an image, and go this
   error, right? Based on the error you’re getting, my best guess is that you double-
   clicked the optimize link, causing it to try and resend the headers, and also
   resulting in some invalid data being thrown around from concurrent optimizations.
   Try it again, and make sure you are only single-clicking.
    If you still have 
   trouble, post the contents of your debug block (settings page), what kind of 
   image you are trying to process (PNG, JPG, GIF), the filesize, and which settings
   you have relevant to that image type.
 *  Plugin Author [nosilver4u](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/something-wrong-invalid-argument-and-cannot-modify-header/#post-3172495)
 * someone else is having a similar error, I’ve reproduced it on my 2nd test server(
   but not the primary oddly), so I’ll see what I can find out.
 *  Plugin Author [nosilver4u](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/something-wrong-invalid-argument-and-cannot-modify-header/#post-3172496)
 * turns out, it’s not really an ‘error’, but a variable I forgot to initialize.
   Unfortunately, it trickles down and breaks the output that is supposed to show
   up when you upload an image. I’ll have 1.2.2 out today.
 *  Plugin Author [nosilver4u](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/something-wrong-invalid-argument-and-cannot-modify-header/#post-3172497)
 * should have mentioned that you can also get rid of this error by turning off 
   WP_DEBUG in your wp-config.php
    i’m working on one more quirk for 1.2.2 but hopefully
   I’ll still get it out the door today.
 *  [Jan Hemmingsen](https://wordpress.org/support/users/orbinaut/)
 * (@orbinaut)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/something-wrong-invalid-argument-and-cannot-modify-header/#post-3172501)
 * Any news on when an update will be out?
 * Unfortunately it also prevents regenerating thumbnails :-/
 * > Regenerate Thumbnails
   >  All done! 0 image(s) were successfully resized in 5 
   > seconds and there were 1 failure(s). To try regenerating the failed images 
   > again, click here. To go back to the previous page, click here.
   > Please be patient while the thumbnails are regenerated. This can take a while
   > if your server is slow (inexpensive hosting) or if you have many images. Do
   > not navigate away from this page until this script is done or the thumbnails
   > will not be resized. You will be notified via this page when the regenerating
   > is completed.
   > 100%
   >  Debugging Information
   > Total Images: 1
   >  Images Resized: 0 Resize Failures: 1
   > function (){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,
   > o(e[0],e[1]))}return this}
 * Thanks for your great work!
 * Cheers
 * Jan
 *  [Jan Hemmingsen](https://wordpress.org/support/users/orbinaut/)
 * (@orbinaut)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/something-wrong-invalid-argument-and-cannot-modify-header/#post-3172502)
 * Forgot to say that WP Debug already is off, which doesn’t prevent the Invalid
   Argument statement.
 * > /**
   >  * For developers: WordPress debugging mode. * * Change this to true to
   > enable the display of notices during development. * It is strongly recommended
   > that plugin and theme developers use WP_DEBUG * in their development environments.*/
   > define(‘WP_DEBUG’, false);
 *  Plugin Author [nosilver4u](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/something-wrong-invalid-argument-and-cannot-modify-header/#post-3172503)
 * odd, I didn’t ever see the warnings until I turned ON debug mode (which I should
   have had on while I was testing…)
 * Anyway, I ran out of time to do testing, so I’ll be wrapping that up today and
   releasing it.

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

The topic ‘Something wrong. Invalid argument and cannot modify header’ is closed
to new replies.

 * ![](https://ps.w.org/ewww-image-optimizer/assets/icon-256x256.png?rev=1582276)
 * [EWWW Image Optimizer](https://wordpress.org/plugins/ewww-image-optimizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ewww-image-optimizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ewww-image-optimizer/)
 * [Active Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ewww-image-optimizer/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [nosilver4u](https://wordpress.org/support/users/nosilver4u/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/something-wrong-invalid-argument-and-cannot-modify-header/#post-3172503)
 * Status: resolved