• Resolved t.tousif

    (@ttousif)


    My debug log is filled with the following only
    Please fix

    Cannot start session when headers already sent in public_html/wp-content/plugins/myworks-woo-sync-for-quickbooks-online/includes/class-myworks-wc-qbo-sync-qbo-lib.php on line 46

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author MyWorks

    (@myworksdesign)

    @ttousif Thanks for reaching out! Have you been able to open a ticket in your account with us yet, at https://support.myworks.software? This will help our team best assist you, as the above PHP warning does not occur with our sync under normal circumstances – but is possibly the result of a conflict with another plugin on your site utilizing PHP sessions in a way that conflicts with ours. We’d be happy to help troubleshoot this further with you, of course!

    I fixed it by changing the line to:

    if(!session_id() && $this->is_allow_php_session() && !headers_sent()) {

    I’m not immediately sure how to narrow down the source.

    The explanation is here:
    https://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php

    I don’t see why the plugin is running on the frontend anyway. Maybe it should just run on is_checkout(), cron and admin.

    Thx a lot for sharing your fix, @brianhenryie ! My php error log file was full with this error:

    View post on imgur.com

    [09-Aug-2022 19:49:40] WARNING: [pool valvarfoodservice.com] child 2333042 said into stderr: "PHP message: PHP Warning:  session_start(): Cannot start session when headers already sent in /var/www/vhosts/valvarfoodservice.com/httpdocs/wp-content/plugins/myworks-woo-sync-for-quickbooks-online/includes/class-myworks-wc-qbo-sync-qbo-lib.php on line 46"
    [09-Aug-2022 19:49:41] WARNING: [pool valvarfoodservice.com] child 2333042 said into stderr: "PHP message: PHP Warning:  session_start(): Cannot start session when headers already sent in /var/www/vhosts/valvarfoodservice.com/httpdocs/wp-content/plugins/myworks-woo-sync-for-quickbooks-online/includes/class-myworks-wc-qbo-sync-qbo-lib.php on line 46"
    [09-Aug-2022 19:50:35] WARNING: [pool valvarfoodservice.com] child 2333165 said into stderr: "PHP message: PHP Warning:  session_start(): Cannot start session when headers already sent in /var/www/vhosts/valvarfoodservice.com/httpdocs/wp-content/plugins/myworks-woo-sync-for-quickbooks-online/includes/class-myworks-wc-qbo-sync-qbo-lib.php on line 46"

    Fortunately and thanks to you, it seems that it stopped happening. With your fix the sync should happen anyway, right?

    Yeah, I don’t see how the change I wrote is related to the real functionality of the sync.

    I changed:

    if(!session_id() && $this->is_allow_php_session()) {
        session_start();
    }

    to

    if(!session_id() && $this->is_allow_php_session() && !headers_sent()) {
        session_start();
    }

    Unfortunately, they just released a new version of the plugin without addressing this issue. There’ll be no 5 star review from me!

    Plugin Author MyWorks

    (@myworksdesign)

    @brianhenryie We appreciate your feedback, and I would like to make sure you’re aware that this improvement is close to the top of our upcoming roadmap. While it didn’t make its way into this recent release, we’re expecting to finish testing on it in the coming 1-2 weeks. Our priority is resolving this PHP session conflict (in the few cases it occurs) in a way that doesn’t affect the rest of the functionality of our sync.

    We’ll be happy to update this thread in the coming 1-2 weeks when we finalize an improvement for this!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Headers already sent’ is closed to new replies.