RuntimeException RuntimeException

HTTP 500 Whoops, looks like something went wrong.

Failed to start the session because headers have already been sent by "/home/apfarm/public_html/index.php" at line 1.

Exceptions 2

RuntimeException

  1.             throw new \RuntimeException('Failed to start the session: already started by PHP.');
  2.         }
  3.         if (ini_get('session.use_cookies') && headers_sent($file, $line))
  4.         {
  5.             throw new \RuntimeException(
  6.                 sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)
  7.             );
  8.         }
  9.         if (!session_start())
  1.                 $this->setId($session_clean);
  2.                 $cookie->set($session_name, '', time() - 3600);
  3.             }
  4.         }
  5.         parent::start();
  6.         // Try loading data from the session
  7.         if (isset($_SESSION['joomla']) && !empty($_SESSION['joomla'])) {
  8.             $this->data = unserialize(base64_decode($_SESSION['joomla']));
  9.         }
  1.         if ($this->isStarted())
  2.         {
  3.             return;
  4.         }
  5.         $this->store->start();
  6.         $this->setState(SessionState::ACTIVE);
  7.         // Initialise the session
  8.         $this->setCounter();
  1.      */
  2.     public function has($name)
  3.     {
  4.         if (!$this->isActive())
  5.         {
  6.             $this->start();
  7.         }
  8.         return $this->store->has($name);
  9.     }
  1.                 $name = $args[2] . '.' . $name;
  2.             }
  3.         }
  4.         if (parent::has($name)) {
  5.             // Parent is used because of b/c, can be changed in Joomla 5
  6.             return parent::get($name, $default);
  7.         }
  8.         /*
Session->get('user') in /home/apfarm/public_html/libraries/src/Factory.php (line 372)
  1.                 __CLASS__
  2.             ),
  3.             E_USER_DEPRECATED
  4.         );
  5.         $instance = self::getApplication()->getSession()->get('user');
  6.         if (\is_null($id)) {
  7.             if (!($instance instanceof User)) {
  8.                 $instance = User::getInstance();
  9.             }
  1. defined('_JEXEC') or die;
  2. $app             = JFactory::getApplication();
  3. $doc             = JFactory::getDocument();
  4. $user            = JFactory::getUser();
  5. $this->language  = $doc->language;
  6. $this->direction = $doc->direction;
  7. // Getting params from template
  8. $params = $app->getTemplate(true)->params;
require('/home/apfarm/public_html/templates/ja_simpli/error.php') in /home/apfarm/public_html/libraries/src/Document/HtmlDocument.php (line 721)
  1.             // Store the file path
  2.             $this->_file = $directory . '/' . $filename;
  3.             // Get the file content
  4.             ob_start();
  5.             require $directory . '/' . $filename;
  6.             $contents = ob_get_contents();
  7.             ob_end_clean();
  8.         }
  9.         return $contents;
HtmlDocument->_loadTemplate('/home/apfarm/public_html/templates/ja_simpli', 'error.php') in /home/apfarm/public_html/libraries/src/Document/HtmlDocument.php (line 776)
  1.         $this->baseurl  = Uri::base(true);
  2.         $this->params   = $params['params'] ?? new Registry();
  3.         $this->template = $template;
  4.         // Load
  5.         $this->_template = $this->_loadTemplate($baseDir, $file);
  6.         return $this;
  7.     }
  8.     /**
HtmlDocument->_fetchTemplate(array('template' => 'ja_simpli', 'directory' => '/home/apfarm/public_html/templates', 'debug' => true, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php')) in /home/apfarm/public_html/libraries/src/Document/HtmlDocument.php (line 612)
  1.      *
  2.      * @since   1.7.0
  3.      */
  4.     public function parse($params = [])
  5.     {
  6.         return $this->_fetchTemplate($params)->_parseTemplate();
  7.     }
  8.     /**
  9.      * Outputs the template to the browser.
  10.      *
HtmlDocument->parse(array('template' => 'ja_simpli', 'directory' => '/home/apfarm/public_html/templates', 'debug' => true, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php')) in /home/apfarm/public_html/libraries/src/Document/HtmlDocument.php (line 630)
  1.     public function render($caching = false, $params = [])
  2.     {
  3.         $this->_caching = $caching;
  4.         if (empty($this->_template)) {
  5.             $this->parse($params);
  6.         }
  7.         if (\array_key_exists('csp_nonce', $params) && $params['csp_nonce'] !== null) {
  8.             $this->cspNonce = $params['csp_nonce'];
  9.         }
HtmlDocument->render(false, array('template' => 'ja_simpli', 'directory' => '/home/apfarm/public_html/templates', 'debug' => true, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php')) in /home/apfarm/public_html/libraries/src/Document/ErrorDocument.php (line 139)
  1.         $this->debug = $params['debug'] ?? false;
  2.         $this->error = $this->_error;
  3.         $params['file'] = 'error.php';
  4.         return parent::render($cache, $params);
  5.     }
  6.     /**
  7.      * Render the backtrace
  8.      *
ErrorDocument->render(false, array('template' => 'ja_simpli', 'directory' => '/home/apfarm/public_html/templates', 'debug' => true, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php')) in /home/apfarm/public_html/libraries/src/Error/Renderer/HtmlRenderer.php (line 78)
  1.                 'template'         => $template->template,
  2.                 'directory'        => JPATH_THEMES,
  3.                 'debug'            => JDEBUG,
  4.                 'csp_nonce'        => $app->get('csp_nonce'),
  5.                 'templateInherits' => $template->parent,
  6.                 'params'           => $template->params,
  7.             ]
  8.         );
  9.     }
  10. }
HtmlRenderer->render(object(RuntimeException)) in /home/apfarm/public_html/libraries/src/Exception/ExceptionHandler.php (line 126)
  1.             // Reset the document object in the factory, this gives us a clean slate and lets everything render properly
  2.             Factory::$document = $renderer->getDocument();
  3.             Factory::getApplication()->loadDocument(Factory::$document);
  4.             $data = $renderer->render($error);
  5.             // If nothing was rendered, just use the message from the Exception
  6.             if (empty($data)) {
  7.                 $data = $error->getMessage();
  8.             }
ExceptionHandler::render(object(RuntimeException)) in /home/apfarm/public_html/libraries/src/Exception/ExceptionHandler.php (line 72)
  1.      * @since   3.10.0
  2.      */
  3.     public static function handleException(\Throwable $error)
  4.     {
  5.         static::logException($error);
  6.         static::render($error);
  7.     }
  8.     /**
  9.      * Render the error page based on an exception.
  10.      *
ExceptionHandler::handleException(object(RuntimeException)) in /home/apfarm/public_html/libraries/src/Application/CMSApplication.php (line 322)
  1.             );
  2.             // Trigger the onError event.
  3.             $this->triggerEvent('onError', $event);
  4.             ExceptionHandler::handleException($event->getError());
  5.         }
  6.         // Trigger the onBeforeRespond event.
  7.         $this->getDispatcher()->dispatch('onBeforeRespond');
CMSApplication->execute() in /home/apfarm/public_html/includes/app.php (line 61)
  1. // Set the application as global app
  2. \Joomla\CMS\Factory::$application = $app;
  3. // Execute the application.
  4. $app->execute();
require_once('/home/apfarm/public_html/includes/app.php') in /home/apfarm/public_html/index.php (line 32)
  1.  * define() is used rather than "const" to not error for PHP 5.2 and lower
  2.  */
  3. define('_JEXEC', 1);
  4. // Run the application - All executable code should be triggered through this file
  5. require_once dirname(__FILE__) . '/includes/app.php';

RuntimeException

Failed to start the session because headers have already been sent by "/home/apfarm/public_html/index.php" at line 1.

  1.             throw new \RuntimeException('Failed to start the session: already started by PHP.');
  2.         }
  3.         if (ini_get('session.use_cookies') && headers_sent($file, $line))
  4.         {
  5.             throw new \RuntimeException(
  6.                 sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)
  7.             );
  8.         }
  9.         if (!session_start())
  1.                 $this->setId($session_clean);
  2.                 $cookie->set($session_name, '', time() - 3600);
  3.             }
  4.         }
  5.         parent::start();
  6.         // Try loading data from the session
  7.         if (isset($_SESSION['joomla']) && !empty($_SESSION['joomla'])) {
  8.             $this->data = unserialize(base64_decode($_SESSION['joomla']));
  9.         }
  1.         if ($this->isStarted())
  2.         {
  3.             return;
  4.         }
  5.         $this->store->start();
  6.         $this->setState(SessionState::ACTIVE);
  7.         // Initialise the session
  8.         $this->setCounter();
  1.      */
  2.     public function has($name)
  3.     {
  4.         if (!$this->isActive())
  5.         {
  6.             $this->start();
  7.         }
  8.         return $this->store->has($name);
  9.     }
  1.                 $name = $args[2] . '.' . $name;
  2.             }
  3.         }
  4.         if (parent::has($name)) {
  5.             // Parent is used because of b/c, can be changed in Joomla 5
  6.             return parent::get($name, $default);
  7.         }
  8.         /*
Session->get('user') in /home/apfarm/public_html/libraries/src/Factory.php (line 372)
  1.                 __CLASS__
  2.             ),
  3.             E_USER_DEPRECATED
  4.         );
  5.         $instance = self::getApplication()->getSession()->get('user');
  6.         if (\is_null($id)) {
  7.             if (!($instance instanceof User)) {
  8.                 $instance = User::getInstance();
  9.             }
  1.      *
  2.      * @since   3.2
  3.      */
  4.     protected function initialiseApp($options = [])
  5.     {
  6.         $user = Factory::getUser();
  7.         // If the user is a guest we populate it with the guest user group.
  8.         if ($user->guest) {
  9.             $guestUsergroup = ComponentHelper::getParams('com_users')->get('guest_usergroup', 1);
  10.             $user->groups   = [$guestUsergroup];
  1.      * @since   3.2
  2.      */
  3.     protected function doExecute()
  4.     {
  5.         // Initialise the application
  6.         $this->initialiseApp();
  7.         // Mark afterInitialise in the profiler.
  8.         JDEBUG ? $this->profiler->mark('afterInitialise') : null;
  9.         // Route the application
  1.             $this->sanityCheckSystemVariables();
  2.             $this->setupLogging();
  3.             $this->createExtensionNamespaceMap();
  4.             // Perform application routines.
  5.             $this->doExecute();
  6.             // If we have an application document object, render it.
  7.             if ($this->document instanceof \Joomla\CMS\Document\Document) {
  8.                 // Render the application output.
  9.                 $this->render();
CMSApplication->execute() in /home/apfarm/public_html/includes/app.php (line 61)
  1. // Set the application as global app
  2. \Joomla\CMS\Factory::$application = $app;
  3. // Execute the application.
  4. $app->execute();
require_once('/home/apfarm/public_html/includes/app.php') in /home/apfarm/public_html/index.php (line 32)
  1.  * define() is used rather than "const" to not error for PHP 5.2 and lower
  2.  */
  3. define('_JEXEC', 1);
  4. // Run the application - All executable code should be triggered through this file
  5. require_once dirname(__FILE__) . '/includes/app.php';

Stack Traces 2

[2/2] RuntimeException
RuntimeException:
Failed to start the session because headers have already been sent by "/home/apfarm/public_html/index.php" at line 1.

  at /home/apfarm/public_html/libraries/vendor/joomla/session/src/Storage/NativeStorage.php:473
  at Joomla\Session\Storage\NativeStorage->start()
     (/home/apfarm/public_html/libraries/src/Session/Storage/JoomlaStorage.php:295)
  at Joomla\CMS\Session\Storage\JoomlaStorage->start()
     (/home/apfarm/public_html/libraries/vendor/joomla/session/src/Session.php:406)
  at Joomla\Session\Session->start()
     (/home/apfarm/public_html/libraries/vendor/joomla/session/src/Session.php:333)
  at Joomla\Session\Session->has('user')
     (/home/apfarm/public_html/libraries/src/Session/Session.php:194)
  at Joomla\CMS\Session\Session->get('user')
     (/home/apfarm/public_html/libraries/src/Factory.php:372)
  at Joomla\CMS\Factory::getUser()
     (/home/apfarm/public_html/templates/ja_simpli/error.php:14)
  at require('/home/apfarm/public_html/templates/ja_simpli/error.php')
     (/home/apfarm/public_html/libraries/src/Document/HtmlDocument.php:721)
  at Joomla\CMS\Document\HtmlDocument->_loadTemplate('/home/apfarm/public_html/templates/ja_simpli', 'error.php')
     (/home/apfarm/public_html/libraries/src/Document/HtmlDocument.php:776)
  at Joomla\CMS\Document\HtmlDocument->_fetchTemplate(array('template' => 'ja_simpli', 'directory' => '/home/apfarm/public_html/templates', 'debug' => true, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php'))
     (/home/apfarm/public_html/libraries/src/Document/HtmlDocument.php:612)
  at Joomla\CMS\Document\HtmlDocument->parse(array('template' => 'ja_simpli', 'directory' => '/home/apfarm/public_html/templates', 'debug' => true, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php'))
     (/home/apfarm/public_html/libraries/src/Document/HtmlDocument.php:630)
  at Joomla\CMS\Document\HtmlDocument->render(false, array('template' => 'ja_simpli', 'directory' => '/home/apfarm/public_html/templates', 'debug' => true, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php'))
     (/home/apfarm/public_html/libraries/src/Document/ErrorDocument.php:139)
  at Joomla\CMS\Document\ErrorDocument->render(false, array('template' => 'ja_simpli', 'directory' => '/home/apfarm/public_html/templates', 'debug' => true, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php'))
     (/home/apfarm/public_html/libraries/src/Error/Renderer/HtmlRenderer.php:78)
  at Joomla\CMS\Error\Renderer\HtmlRenderer->render(object(RuntimeException))
     (/home/apfarm/public_html/libraries/src/Exception/ExceptionHandler.php:126)
  at Joomla\CMS\Exception\ExceptionHandler::render(object(RuntimeException))
     (/home/apfarm/public_html/libraries/src/Exception/ExceptionHandler.php:72)
  at Joomla\CMS\Exception\ExceptionHandler::handleException(object(RuntimeException))
     (/home/apfarm/public_html/libraries/src/Application/CMSApplication.php:322)
  at Joomla\CMS\Application\CMSApplication->execute()
     (/home/apfarm/public_html/includes/app.php:61)
  at require_once('/home/apfarm/public_html/includes/app.php')
     (/home/apfarm/public_html/index.php:32)                
[1/2] RuntimeException
RuntimeException:
Failed to start the session because headers have already been sent by "/home/apfarm/public_html/index.php" at line 1.

  at /home/apfarm/public_html/libraries/vendor/joomla/session/src/Storage/NativeStorage.php:473
  at Joomla\Session\Storage\NativeStorage->start()
     (/home/apfarm/public_html/libraries/src/Session/Storage/JoomlaStorage.php:295)
  at Joomla\CMS\Session\Storage\JoomlaStorage->start()
     (/home/apfarm/public_html/libraries/vendor/joomla/session/src/Session.php:406)
  at Joomla\Session\Session->start()
     (/home/apfarm/public_html/libraries/vendor/joomla/session/src/Session.php:333)
  at Joomla\Session\Session->has('user')
     (/home/apfarm/public_html/libraries/src/Session/Session.php:194)
  at Joomla\CMS\Session\Session->get('user')
     (/home/apfarm/public_html/libraries/src/Factory.php:372)
  at Joomla\CMS\Factory::getUser()
     (/home/apfarm/public_html/libraries/src/Application/SiteApplication.php:562)
  at Joomla\CMS\Application\SiteApplication->initialiseApp()
     (/home/apfarm/public_html/libraries/src/Application/SiteApplication.php:226)
  at Joomla\CMS\Application\SiteApplication->doExecute()
     (/home/apfarm/public_html/libraries/src/Application/CMSApplication.php:293)
  at Joomla\CMS\Application\CMSApplication->execute()
     (/home/apfarm/public_html/includes/app.php:61)
  at require_once('/home/apfarm/public_html/includes/app.php')
     (/home/apfarm/public_html/index.php:32)