KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
TL;DR Getting an error on a Linux box with Nginx / PHP-FPM stating "Failed to start the session because headers have already been sent.". Error is not occurring on Apache local machine setup So on my local machine I have the Symfony2 app running fine. No errors are popping up. But as soon as I deploy to our Linux Server I'm getting this error when I call a certain Action within a Controller class Failed to start the session because headers have already been sent. In the index action I have already called $session = $this->getRequest()->getSession(); And in another action within the same controller class I'm calling it again. The error pops up when I try a $session->set('foo', $bar); In my Twig I'm calling the action by a form and a button with a formaction property like so <form id='blahblah'> .... some fields here ..... <button type='submit' formaction='{{path('2ndAction')}}'></a> </form> So on my local machine, running Apache everything run fine. The Linux server is using Nginx and php-fpm and it's crashing for some reason. I checked the phpInfo() and the session auto start is set to off. Not sure if this is an Nginx/php-fpm issue or not but I thought it may be pertinent information. Here is the Controller declaration, indexAction(), and my 2ndAction() use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Session\Session; use CBSi\Utils\HTTPUtils\CURLUtil; class StartController extends Controller { /** * @var CurlUtil $curlUtil */ private $curlUtil; /** * @var Acces
Tags (comma-separated)
Save Edits
Cancel