We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Troubleshooting header mssg with EE 5

How Do I?

Natalie's avatar
Natalie
15 posts
6 years ago
Natalie's avatar Natalie

Hi, I thought I’d fixed this, but it’s on a bunch of my pages apparently. I get this message since upgrading to EE 5. Any help is appreciated.

Warning

session_start(): Cannot start session when headers already sent

ee/legacy/libraries/Functions.php(627) : eval()’d code, line 3

       
Derek Jones's avatar
Derek Jones
7,561 posts
6 years ago
Derek Jones's avatar Derek Jones

Hi Natalie! Do you have PHP in your templates? Which version were you on before, and what do you mean that you thought you had fixed this? When did it appear before, and what did you do to fix it?

       
Natalie's avatar
Natalie
15 posts
6 years ago
Natalie's avatar Natalie

Hi, I was on EE 4.3 before and php is off for templates. I used php session vars for storing things for games, I saw the error on one of my games and moved the session_start code to my header template (turning php on for the header) and that seemed to fix it, but then I noticed it was on my other game pages as well a few days later, even though when I tested them on the day the one game had the error, they seemed fine. I ended up removing the session start from the header and turning php back off for that template and everything seems to be back to normal for now….I just have no idea what caused it. I had made no other changes to my code other than upgrading EE.

       
Derek Jones's avatar
Derek Jones
7,561 posts
6 years ago
Derek Jones's avatar Derek Jones

It was likely an intermittent error, but essentially it sounds like your code was sending output to the web server before trying to start a PHP-based session, which can’t be done. Where was this PHP code before you moved it to your header template?

       
Natalie's avatar
Natalie
15 posts
6 years ago
Natalie's avatar Natalie

It was in my add on’s mod.php file within a tag

       
Derek Jones's avatar
Derek Jones
7,561 posts
6 years ago
Derek Jones's avatar Derek Jones

So it was within a method and not outside of the class? Do any of your custom add-on files have closing PHP tags? You might have some whitespace at the end of them which is causing content (the whitespace) to be sent to the web server immediately.

       
Natalie's avatar
Natalie
15 posts
6 years ago
Natalie's avatar Natalie

Correct, within the method. My add on does not have a closing php tag, should it? The last thing is the } closing the class.

       
Derek Jones's avatar
Derek Jones
7,561 posts
6 years ago
Derek Jones's avatar Derek Jones

No, it should definitely not have a closing PHP tag. I suspect you need someone to help you step-trace your add-on’s execution to see why that error is occurring. Our team would be happy to do that for you if you want to put in a support ticket.

       
Natalie's avatar
Natalie
15 posts
6 years ago
Natalie's avatar Natalie

Sadly I’m just a one-person amature with a site bringing in no revenue so I can’t afford to pay for support with the new pricing plans.

I get the errors on my control panel as w well when updating any of the member profile fields. Copy and pasting it in case anyone can give me any pointers as to where to go to fix the issues as I don’t feel like it’s omething on my end given it’s showing up here too and I definitely didn’t change anything on EE’s code ever. I looked at all my EE add-ons under the control panel and didn’t see any that needed updating, so not sure where else to go.

Warning

in_array() expects parameter 2 to be array, bool given

ee/EllisLab/ExpressionEngine/Controller/Members/Profile/Profile.php, line 342 •Severity: E_WARNING

Warning

in_array() expects parameter 2 to be array, bool given

ee/EllisLab/ExpressionEngine/Controller/Members/Profile/Profile.php, line 342 •Severity: E_WARNING

Warning

in_array() expects parameter 2 to be array, bool given

ee/EllisLab/ExpressionEngine/Controller/Members/Profile/Profile.php, line 342 •Severity: E_WARNING

Warning

Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:122)

ee/legacy/core/Input.php, line 238 •Severity: E_WARNING

Warning

Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:122)

ee/legacy/libraries/Functions.php, line 393 •Severity: E_WARNING

       
Derek Jones's avatar
Derek Jones
7,561 posts
6 years ago
Derek Jones's avatar Derek Jones

Add-ons can affect any page, and modify the database in any location, fwiw, so that is not indicative of an error or bug with the application. You might try on Slack or StackExchange for help as well.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.