Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$_SERVER['PHP_SELF'] can be empty with nginx/php-fpm #7635

Closed
MrPetovan opened this issue Sep 17, 2019 · 4 comments

Comments

@MrPetovan
Copy link
Collaborator

commented Sep 17, 2019

The current sample-nginx.config file states:

NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

This seems to make $_SERVER['PHP_SELF'] empty and subsequently makes Friendica treat every request as a backend one, disabling sessions, which prevents login altogether.

We should either:

  • Stop suggesting this configuration (a discussion about this value can be found here)
  • Use a different $_SERVER key for backend determination, like possibly SCRIPT_FILENAME which is present regardless of this configuration.

I'm not familiar with the nginx/php-fpm setup, so I'll leave up to someone else to decide although I would prefer a more robust code that doesn't depend on platform-dependent $_SERVER keys.

@MrPetovan MrPetovan added this to the 2019.09 milestone Sep 17, 2019
@annando

This comment has been minimized.

Copy link
Collaborator

commented Sep 17, 2019

Can this be the reason for the problem that one user reported after update?

@rebeka-catalina

This comment has been minimized.

Copy link

commented Sep 17, 2019

@MrPetovan

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 17, 2019

Thanks for the testimonial, with Adam Clarke we were surprised no one else came forward with the same issue before, so it doesn't just depend on this configuration key. One more reason to make the code as ubiquitous as possible.

@MrPetovan

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 17, 2019

$_SERVER['PHP_SELF'] isn't used anymore in the Friendica codebase thanks to #7639 .

@MrPetovan MrPetovan closed this Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.