|
Joined: Jul 2007
Posts: 103
member
|
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 .
|
|
|
|
Joined: Jun 2006
Posts: 16,292 Likes: 116
|
Joined: Jun 2006
Posts: 16,292 Likes: 116 |
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...
|
|
|
|
Joined: Jul 2007
Posts: 103
member
|
member
Joined: Jul 2007
Posts: 103 |
I guess your right. BTW Is this fixed in the newest ubb release?
|
|
|
|
Joined: Jun 2006
Posts: 16,292 Likes: 116
|
Joined: Jun 2006
Posts: 16,292 Likes: 116 |
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
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
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.
|
|
|
|
Joined: Dec 2003
Posts: 1,796
Pooh-Bah
|
Pooh-Bah
Joined: Dec 2003
Posts: 1,796 |
Yay I have a client's site that's having a bit of an issue with it (snakebit with about every aspect of his site )
|
|
|
|
Joined: Dec 2003
Posts: 1,796
Pooh-Bah
|
Pooh-Bah
Joined: Dec 2003
Posts: 1,796 |
That's something like what I'm seeing now, it cuts off after ubbthreads.php?
|
|
|
|
Joined: Jun 2006
Posts: 16,292 Likes: 116
|
Joined: Jun 2006
Posts: 16,292 Likes: 116 |
sounds like path_info just isn't being populated
|
|
|
|
Joined: Jul 2007
Posts: 103
member
|
member
Joined: Jul 2007
Posts: 103 |
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.phpPATH_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.
|
|
|
|
|