Previous Thread
Next Thread
Print Thread
Hop To
7.3 Bug: SERVER["PATH_INFO"] may not be used
#216334 08/09/2008 10:49 AM
Joined: Jul 2007
Posts: 103
nims2 Offline OP
member
OP Offline
member
Joined: Jul 2007
Posts: 103
When migrating my box to the newest version of php, I noticed that friendly URL's are no longer working when I enabled them.

Looking through several sites and forum, i've found out that a setting in php.ini can fix this. BUT it appears that it is a bug in PHP that is being used by UBB, which should be.

The quick fix is to edit the php.ini of your site, and set:
cgi.fix_pathinfo=0
(disabling the original fix)

The comment in this settings tells it all:

; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
; this to 1 will cause PHP CGI to fix it's paths to conform to the spec. A setting
; of zero causes PHP to behave as before. Default is zero. You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
cgi.fix_pathinfo=0


So UBB, please change your code the way it is supposed to be wink.

Re: 7.3 Bug: SERVER["PATH_INFO"] may not be used
nims2 #216335 08/09/2008 11:24 AM
Joined: Jun 2006
Posts: 15,956
Likes: 31
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 15,956
Likes: 31
I think Path_info_translated was a fix that rarely occoured that path_info wouldn't populate; seems we need to take that a step further with another if/else clause to work of of script_filename as well...


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: 7.3 Bug: SERVER["PATH_INFO"] may not be used
Gizmo #216642 08/28/2008 6:39 PM
Joined: Jul 2007
Posts: 103
nims2 Offline OP
member
OP Offline
member
Joined: Jul 2007
Posts: 103
I guess your right. BTW Is this fixed in the newest ubb release?

Re: 7.3 Bug: SERVER["PATH_INFO"] may not be used
nims2 #216647 08/29/2008 12:41 AM
Joined: Jun 2006
Posts: 15,956
Likes: 31
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 15,956
Likes: 31
doubt it, as the translated check was only added in 7.2... You'd have to likely wait for Rick to update the topic when he fixes it


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: 7.3 Bug: SERVER["PATH_INFO"] may not be used
Gizmo #216653 08/29/2008 11:11 AM
Joined: Jun 2006
Posts: 9,243
Former Developer
Offline
Former Developer
Joined: Jun 2006
Posts: 9,243
I'm looking on a proper solution for this with the variety of way we parse all of the data. Not sure if this will get into 7.3.2, but we'll see.

Re: 7.3 Bug: SERVER["PATH_INFO"] may not be used
Rick #216655 08/29/2008 12:02 PM
Joined: Dec 2003
Posts: 1,796
Pooh-Bah
Offline
Pooh-Bah
Joined: Dec 2003
Posts: 1,796
Yay smile I have a client's site that's having a bit of an issue with it (snakebit with about every aspect of his site smile )


- Allen
- ThreadsDev | PraiseCafe
Re: 7.3 Bug: SERVER["PATH_INFO"] may not be used
AllenAyres #216719 09/02/2008 12:21 PM
Joined: Jun 2006
Posts: 9,243
Former Developer
Offline
Former Developer
Joined: Jun 2006
Posts: 9,243
Well, the problem is that SCRIPT_FILENAME just contains the path to the script, it doesn't contain anything after it.

So, something like this:

https://www.ubbcentral.com/forums/ubbthreads.php/ubb/showflat/Number/216111

SCRIPT_FILENAME only contains:

https://www.ubbcentral.com/forums/ubbthreads.php/ubb/showflat

It chops off the actual data that we need to know what topic to show.

Re: 7.3 Bug: SERVER["PATH_INFO"] may not be used
Rick #216729 09/02/2008 3:49 PM
Joined: Dec 2003
Posts: 1,796
Pooh-Bah
Offline
Pooh-Bah
Joined: Dec 2003
Posts: 1,796
That's something like what I'm seeing now, it cuts off after ubbthreads.php?


- Allen
- ThreadsDev | PraiseCafe
Re: 7.3 Bug: SERVER["PATH_INFO"] may not be used
AllenAyres #216739 09/02/2008 6:38 PM
Joined: Jun 2006
Posts: 15,956
Likes: 31
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 15,956
Likes: 31
sounds like path_info just isn't being populated


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: 7.3 Bug: SERVER["PATH_INFO"] may not be used
Rick #220109 12/10/2008 9:20 AM
Joined: Jul 2007
Posts: 103
nims2 Offline OP
member
OP Offline
member
Joined: Jul 2007
Posts: 103
Originally Posted by Rick
Well, the problem is that SCRIPT_FILENAME just contains the path to the script, it doesn't contain anything after it.

So, something like this:

https://www.ubbcentral.com/forums/ubbthreads.php/ubb/showflat/Number/216111

SCRIPT_FILENAME only contains:

https://www.ubbcentral.com/forums/ubbthreads.php/ubb/showflat

It chops off the actual data that we need to know what topic to show.

Did you check the apache settings? Looking at the PHP documentation:
http://www.php.net/manual/en/reserved.variables.server.php
'PATH_TRANSLATED'
Filesystem- (not document root-) based path to the current script, after the server has done any virtual-to-real mapping.

Note: As of PHP 4.3.2, PATH_TRANSLATED is no longer set implicitly under the Apache 2 SAPI in contrast to the situation in Apache 1, where it's set to the same value as the SCRIPT_FILENAME server variable when it's not populated by Apache. This change was made to comply with the CGI specification that PATH_TRANSLATED should only exist if PATH_INFO is defined.
Apache 2 users may use AcceptPathInfo = On inside httpd.conf to define PATH_INFO.

also this is found for php5:
http://www.php.net/manual/en/migration5.incompatible.php
PATH_TRANSLATED server variable is no longer set implicitly under Apache2 SAPI in contrast to the situation in PHP 4, where it is set to the same value as the SCRIPT_FILENAME server variable when it is not populated by Apache. This change was made to comply with the » CGI specification. Please refer to » bug #23610 for further information, and see also the $_SERVER['PATH_TRANSLATED'] description in the manual. This issue also affects PHP versions >= 4.3.2.

Also a non elegant workaround is:
if (!defined(’MAIN_EXEC_DIR’)) define(’MAIN_EXEC_DIR’, dirname(__FILE__));

Then MAIN_EXEC_DIR would always contain the information you are looking for. Certainly, it’s a pain to have to put this in every file, though.


I think the code that finds out the path should become a little smarter to use different ways to find out what the complete URL is.


Link Copied to Clipboard
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Disaster!!! Files became empty.. Please advise.
by Morgan - 07/27/2020 2:38 PM
Unable to Update Censor List
by BOTCuser - 07/22/2020 9:15 AM
7.7.4 error on rebuilders
by Ruben - 07/21/2020 3:06 PM
[STOCK] UBB.threads Group Image Pack
by isaac - 07/19/2020 9:03 PM
Who's Online Now
1 members (Ruben), 79 guests, and 42 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Amusing Terain Scenics
Amusing Terain Scenics
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 7.7.5
(Snapshot build 20200804)