3

I've developed a system using zend framework 3 and is working fine in my notebook, but when I try to run on a CentOS server it failed creating a session container.

Session error image

Session error image 2

I already compilated selinux modules, so it's OK

Somebody knows how to fix it?

Notebook configuration

  • Linux Mint 18.2

  • Apache

Server version: Apache/2.4.18 (Ubuntu)

Server built: 2018-06-07T19:43:03

  • Php

PHP 7.2.10-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Oct 1 2018 11:45:50) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.10-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

  • Php info

https://drive.google.com/open?id=1ZnmxugSDbtBvZFEBDj7SudxLNaQkl3WU

Server configuration (CentOS)

  • Red Hat Enterprise Linux Server 7.5 (Maipo)

  • Apache

Server version: Apache/2.4.6 (Red Hat Enterprise Linux)

Server built: May 28 2018 16:19:32

  • Php info

https://drive.google.com/open?id=1DUrc2tEfxOpkGyT0mGv59jlVWOQhKcA9

EDIT

I've found the problem. In my global.php I've config my session_manager with the validator RemoteAddr, when I removed it,it worked fine.

Does anyone know why did that happen?

  • did you try stepping with xdebug through the code to see what the actual error is? The thrown error (AuthenticationService could not be created) means that it failed in a Factory which was trying to inject the AuthenticationService into somewhere. Next, it might be the Factory which is called to create that Service before it gets injected which failed because it tried to use RemoteAddr validator, which on it's on failed for X reason. That cascading failure resulted in the single error you're asking about. Like in school, you need to find X ;-) – rkeet Oct 10 '18 at 06:14

2 Answers2

0

Thinking about it, it may be blocking my connection to remote database, that's the only difference

  • 1
    This is no answer to the question. If you found a solution to your own problem, give it as a [good answer](https://stackoverflow.com/help/how-to-answer) – gehbiszumeis Jan 18 '19 at 12:28
  • My solution was describe on EDIT, I remove the module that block remote addr, and now I answer why it work: my database is remote and it was block – Nathália Pissuti Jan 18 '19 at 13:01
0

I run into exactly the same problem today. I could trace back the problem to only be browser related. Clearing my cookies solved the issue.

I was logged into the app with no problem.

Then run a deployment and after that the error occurred. I guess some token was regenerated after the deployment and the stored session cookie contained the old one. That seems to trigger this error.

If you run into this problem, first try another browser to see if this applies to you.

cb0
  • 8,415
  • 9
  • 52
  • 80