Bug #70757 [Opn->Csd]: $_SERVER["PHP_SELF"] is malformed with PHP-FPM and Apache 2.4.17

From: Date: Thu, 04 Jan 2024 19:44:10 +0000
Subject: Bug #70757 [Opn->Csd]: $_SERVER["PHP_SELF"] is malformed with PHP-FPM and Apache 2.4.17
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-246174@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70757&edit=1 ID: 70757 Updated by: bukka@php.net Reported by: admin at franceserv dot fr Summary: $_SERVER["PHP_SELF"] is malformed with PHP-FPM and Apache 2.4.17 -Status: Open +Status: Closed Type: Bug -Package: *Directory/Filesystem functions +Package: FPM related Operating System: Linux Debian PHP Version: Irrelevant -Assigned To: +Assigned To: bukka Block user comment: N Private report: N New Comment: This has been addressed long time ago and it was actually an FPM issue. Previous Comments: ------------------------------------------------------------------------ [2015-11-05 09:41:53] fullermd+php at over-yonder dot net It seems that Apache is going to revert that change for 2.4.18. x-ref https://bz.apache.org/bugzilla/show_bug.cgi?id=57785 http://svn.apache.org/viewvc?view=revision&revision=1712268 Or rather, not quite revert it, but make it configurable, with the default off. Applying the patch from SVN on top of 2.4.17 (doesn't apply cleanly to CHANGES and manual, but the code does fine) puts things back to normal. Doesn't really help until the .18 release, of course. And since it's configurable, PHP probably still needs to handle it for cases where it's turned on. ------------------------------------------------------------------------ [2015-11-04 19:16:53] alec at alec dot pl Looks like $_SERVER['SCRIPT_NAME'] is wrong too. http://trac.roundcube.net/ticket/1490582 ------------------------------------------------------------------------ [2015-10-22 17:25:05] fullermd+php at over-yonder dot net Well, no, you're not the only one; I see it too, or I wouldn't be here :) I would presume it probably needs a PHP fix to follow the Apache change. I've hacked around it in the places it's bitten me with parse_url: -$self = $_SERVER['PHP_SELF']; +$self = parse_url($_SERVER['PHP_SELF'], PHP_URL_PATH); AFAICT from the docs, it Should(tm) work with the bare path as well as a fuller URL, and testing shows it currently does, so that D'sTRT for either behavior. That's enough to get me through the night at least, though if you're directly ref'ing PHP_SELF through the code rather than having a single choke point (or possibly using some other _SERVER var that's affected by the change), you'll have a harder time... ------------------------------------------------------------------------ [2015-10-22 16:30:31] admin at franceserv dot fr The problem is a website could use this variable and don't work anymore with a simple update between 2 tiny sub-version of Apache. And a biger problem with this change is : several website were broke because the url rewrite wasn't working correctly. At the moment, it's not possible for me to update Apache about this problem, except if i find a way with PHP-FPM to solve the problem. I would like know if i'm alone with this bug with Apache 2.4.17 and PHP-FPM :) And the more important, how to solve the problem. I don't know if the solution need to come from Apache or PHP side. Between, thank you a lot for your tints. ------------------------------------------------------------------------ [2015-10-22 16:13:56] fullermd+php at over-yonder dot net Note that it also includes the query string (if any), as well as the scheme/host. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=70757 -- Edit this bug report at https://bugs.php.net/bug.php?id=70757&edit=1

« previous php.bugs (#246174) next »