Title: PHP warning
Last modified: May 14, 2019

---

# PHP warning

 *  Resolved [mickwall](https://wordpress.org/support/users/mickwall/)
 * (@mickwall)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/php-warning-195/)
 * Hi
 * I am seeing a lot of warnings in my php error log.
 * I wonder if you could help.
 * The error is
 * 14-May-2019 09:11:47 UTC] PHP Warning: Cannot modify header information – headers
   already sent in /wp-content/plugins/my-tickets/mt-button.php on line 784
 * Thanks

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

 *  Plugin Author [Joe Dolson](https://wordpress.org/support/users/joedolson/)
 * (@joedolson)
 * [7 years ago](https://wordpress.org/support/topic/php-warning-195/#post-11536017)
 * Unfortunately, this is most likely a problem in another plug-in or your theme
   that’s triggering an error in My Tickets.
 * Most likely, you have some other software that’s printing information to the 
   screen either in the ‘init’ phase or earlier, and that’s causing this error in
   My Tickets.
 * In general, no content should be printed to the screen during the initialization
   phase, as that prevents headers from being sent.
 *  Thread Starter [mickwall](https://wordpress.org/support/users/mickwall/)
 * (@mickwall)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/php-warning-195/#post-11829195)
 * OK Joe, Thanks. Any tips on working it out?
 *  Plugin Author [Joe Dolson](https://wordpress.org/support/users/joedolson/)
 * (@joedolson)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/php-warning-195/#post-11829404)
 * First step is to find out what is causing the issue. Disable all plugins and 
   see if it goes away; if not, switch to a default theme. Once you’ve got the warnings
   gone, activate things one at a time until you find out what is causing the issue.
 *  Thread Starter [mickwall](https://wordpress.org/support/users/mickwall/)
 * (@mickwall)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/php-warning-195/#post-11838569)
 * Hi Joe
 * I have done lots of debugging including using troubleshooting mode with no plugins
   enabled and the twenty nineteen theme, the error still occured!
 * I am wondering if this error could be being created by cron jobs, I have added
   the following to your code and the error has stopped. I am not sure if this is
   right or even makes sense.
 * function mt_set_user_unique_id() {
    $unique_id = ( isset( $_COOKIE[‘mt_unique_id’]))?
   $_COOKIE[‘mt_unique_id’] : false; if ( ! $unique_id ) { if ( !defined( ‘DOING_CRON’)){
   $unique_id = mt_generate_unique_id(); setcookie( ‘mt_unique_id’, $unique_id, 
   time() + 60 * 60 * 24 * 7, COOKIEPATH, COOKIE_DOMAIN, true, true ); } } }
 * Apologies if this is wasting your time!
 *  Thread Starter [mickwall](https://wordpress.org/support/users/mickwall/)
 * (@mickwall)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/php-warning-195/#post-11838952)
 * Hi
 * I did a bit more tidying!
 * function mt_set_user_unique_id() {
    if (( defined( ‘DOING_CRON’ ) AND DOING_CRON)
   == false) { $unique_id = ( isset( $_COOKIE[‘mt_unique_id’] ) ) ? $_COOKIE[‘mt_unique_id’]:
   false; if ( ! $unique_id ) { $unique_id = mt_generate_unique_id(); setcookie(‘
   mt_unique_id’, $unique_id, time() + 60 * 60 * 24 * 7, COOKIEPATH, COOKIE_DOMAIN,
   true, true ); } } }
 * I can see the cookie being created when I refresh a page event in the back office.
   I assume this is meant to check / create the cookie every time a page is loaded?
 * I am a develper but not wordpress / php!
 * Love the plugin by the way, simple to use and just works!
 *  Thread Starter [mickwall](https://wordpress.org/support/users/mickwall/)
 * (@mickwall)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/php-warning-195/#post-11870621)
 * Thanks for adding a fix to the latest update.

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

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

 * ![](https://ps.w.org/my-tickets/assets/icon-256x256.png?rev=1097581)
 * [My Tickets - Accessible Event Ticketing](https://wordpress.org/plugins/my-tickets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/my-tickets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/my-tickets/)
 * [Active Topics](https://wordpress.org/support/plugin/my-tickets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/my-tickets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/my-tickets/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [mickwall](https://wordpress.org/support/users/mickwall/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/php-warning-195/#post-11870621)
 * Status: resolved