getherbert / herbert

The WordPress Plugin Framework:
http://getherbert.com/
632 stars 94 forks source link

PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Failed to start the session because headers have already been sent #117

Closed giwrgos88 closed 8 years ago

giwrgos88 commented 8 years ago

I have created two plugins using the herbert. When I'm trying to activate the second plugin on the live server I'm getting the following error message

[27-May-2016 14:37:34 UTC] PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Failed to start the session because headers have already been sent by "/home/***/public_html/wp-includes/functions.php" at line 3792.' in /home/**/public_html/wp-content/plugins/plugin-1/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:134
Stack trace:
#0 /home/**/public_html/wp-content/plugins/plugin-1/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php(258): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
#1 /home/****/public_html/wp-content/plugins/plugin-1/vendor/symfony/http-foundation/Session/Session.php(237): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->getBag('flashes')
#2 /home/***/public_html/wp-content/plugins/plugin-1/vendor/symfony/http-foundation/Session/Session.php(247): Symfony\Component\HttpFoundation\Session\Session->getBag('flashes')
#3 /home in /home/**/public_html/wp-content/plugins/plugin-1/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php on line 134

Does anyone knows why? On the demo server is working fine which the wordpress site is a clone of the live

moazam1 commented 8 years ago

Check line 3792 in your functions.php. You are sending output to client. There may be spaces or whitelines

jeremyzahner commented 8 years ago

@moazam1 That's the wp-includes functions.php. So that might not be the issue.

@giwrgos88 Did you properly namespace both of the plugins to resolve conflicts in the first place?

giwrgos88 commented 8 years ago

the issue was the php version, we upgraded it and now is working fine