0

I installed a CMS, named Prestashop: it runs under a specific domain, and with a specific VirtualHost configuration on Apache, on a server with other PHP applications (Wordpress).

When I try to login in, as administrator user, I receive the following error (this is the Apache error log):

[Wed Jan 18 00:09:16.059190 2017] [:error] [pid 31253] [client xx.xx.xx.xx:63129] PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Failed to start the session: already started by PHP.' in /opt/wp/apps/prestashop/app/cache/prod/classes.php:108\nStack trace:\n#0 /opt/wp/apps/prestashop/app/cache/prod/classes.php(483): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()\n#1 /opt/wp/apps/prestashop/vendor/symfony/symfony/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php(90): Symfony\Component\HttpFoundation\Session\Session->start()\n#2 /opt/wp/apps/prestashop/vendor/symfony/symfony/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php(54): Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage->hasToken('ANONYMOUS_USER')\n#3 /opt/wp/apps/prestashop/app/cache/prod/classes.php(8196): Symfony\Component\Security\Csrf\CsrfTokenManager->getToken('ANONYMOUS_USER')\n#4 /opt/wp/apps/prestashop/classes/Link.php(722): PrestaShopBundle\Service\Routing\Router->generate('admin_product_c...')\n#5 /opt/wordpre in /opt/wp/apps/prestashop/app/bootstrap.php.cache on line 3216, referer: http://www.xxxxx.xx/adminXXX/index.php?controller=AdminLogin&token=181fa270d47386a8d523bdea6213932c&redirect=AdminDashboard'

The error is retrieved by a stable release of Prestashop, so I don't think that it can depend on code problem. Is it that WordPress first opens a session, and then Symfony (Prestashop) finds the session already open? The main domain is infact served by WP. I also try to define a specific path for the Prestashop VirtualHost: https://stackoverflow.com/questions/18262878/how-to-prevent-php-sessions-being-shared-between-different-apache-vhosts Unfortunately it doesn't work.

PHP session auto_start parameter is set to 0 in php.ini.

I don't understand how can I solve this problem. It can be depends on an Apache or PHP configuration?

Thanks a lot.

1 Answers1

0

You have some characters outside of your PHP, before the session_start command. Most likely spaces after the closing tag ?>

This is why closing tags should not be at end of file, this has been codified in the PSR2 standard.

Ensure you are uploading all files with correct FTP settings and check for any accidental changes. Worst case put var_dump(headers_sent().__FILE_d); in all files included before your error message.

jdog
  • 111
  • 4
  • 28