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.

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'

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.

  • 2
    the error is self-explanatory; look through all your files – Funk Forty Niner Jan 19 '17 at 19:34
  • Fred, I know not so well php coding and I was hoping not to have to edit a cms code, what do you mean? – Round Robin Jan 19 '17 at 20:29
  • put your files on your own computer that are session-related and do a search for all of them containing `session_start();` you'll find it. – Funk Forty Niner Jan 19 '17 at 20:30
  • 6 or 7 files contains 'session_start()' – Round Robin Jan 19 '17 at 21:40
  • See http://php.net/manual/en/function.session-status.php and http://stackoverflow.com/q/6249707/1415724 - if you have included files that start the session or require'd files, then that could cause it. – Funk Forty Niner Jan 19 '17 at 21:45
  • Add symfony tag to your question, i don't know well prestashop 1.7 you should google the error and adding symfony – tarek fellah Jan 20 '17 at 08:19
  • Fred, thank you very much, but do you think it can be a problem of prestashop coding? this version is released as stable. – Round Robin Jan 20 '17 at 10:58
  • Tarek, for now I found only the same issues that Fred suggests to me. I understand the problem, but I'm not understand if it can be a problem of the environment or a specific cms issue. – Round Robin Jan 20 '17 at 11:01
  • I've the following doubt: is it possible that WordPress first opens a session, and then Symfony 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: http://stackoverflow.com/questions/18262878/how-to-prevent-php-sessions-being-shared-between-different-apache-vhosts. Unfortunately it doesn't work. – Round Robin Jan 20 '17 at 11:32

1 Answers1

0

I Just got the same issue with my Symfony 3.2 app, i was upgrading my web server from php 5.5.12 to php 5.6.31 when it happened. After upgrading again to php 7.0.23 everything go back to normal.

NDZIE Patrick Joel
  • 1,114
  • 14
  • 26