Resolved Bug


This bug has been marked as resolved.

PATH_INFO problem

Permalink 111 101 Browser Info Environment
Very often discussed here... The PATH_INFO problem. We found a solution / work-around for this.

I think this issue should be really fixed in concrete5. Concrete5 does not work correctly if PHP is executed via FastCGI.

Just write me a message and I provide you a demo account on a correct configured server running PHP as FastCGI.

See also this forum entry:
http://www.concrete5.org/community/forums/installation/path_info-pr...

and this:
http://www.concrete5.org/community/forums/customizing_c5/pretty_url...


Status: Resolved
scalait
View Best Answer
scalait replied on at Permalink
scalait
this bug still exists. I will post our bugfix here soon.
scalait replied on at Best Answer Permalink
scalait
the current version of the function "get()" in the "Request" class (/concrete/libraries/request.php) checks the following server variables:

- ORIG_PATH_INFO
- PATH_INFO
- SCRIPT_NAME

if PHP is installed as a FastCGI version, the webserver (in our case: Apache) provides another variable:

- REDIRECT_URL

concrete5 has also to check for this variable. so here is our bugfix / corrected version of the "get()" function:

public static function get() {
      static $req;
      if (!isset($req)) {         
         $path = false;
         if (defined('SERVER_PATH_VARIABLE')) {
            $path = Request::parsePathFromRequest(SERVER_PATH_VARIABLE);
         }
         if (!$path) {
            $path = Request::parsePathFromRequest('ORIG_PATH_INFO');
         }
         if (!$path) {
            $path = Request::parsePathFromRequest('PATH_INFO');
         }
         if (!$path) {
            $path = Request::parsePathFromRequest('SCRIPT_NAME');

(attention -> you have to click on "View entire code block" to see everything)

Please, can someone add this to git?

I know that there is another way (by defining the config variable "SERVER_PATH_VARIABLE"), but I think we should add the server "REDIRECT_URL" to make concrete5 work without problems in a FastCGI enviroment.
Mnkras replied on at Permalink
Mnkras
this was actually posted in the pro or community leaders forum, can't remember...

Thanks,
hereNT replied on at Permalink
hereNT
I finally got a chance to check this, and it looks like the fix works in my environment. Now I can do the same pretty url .htaccess in both module and fast cgi mode, I'm so happy - I don't know how many hours I spent trying to figure this out. THANK YOU!!!!
hereNT replied on at Permalink
hereNT
I guess this worked on my local server running php as fast cgi, but not on the live server which is also runnin php as fast cgi. I'm not sure what the difference is between the two.

Regardless, this is a really annoying bug, I wish there was a solution.
scalait replied on at Permalink
scalait
can someone add this change to GIT?
andrew replied on at Permalink
andrew
This has been in git for a little while. Should be available in the next version.
Ashlann replied on at Permalink
Ashlann
it would *seem* this is the error I am seeing site-wide; would love the solution. Thanks.

concrete5 Environment Information

# Version genehmigen
5.4.1

# Package deinstallieren
Keine

# Concrete5 aktualisieren
languages/de_DE

# Server Software
Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8e-fips-rhel5

# Server API
cgi-fcgi

# PHP Version
5.2.14

# Geladene Erweiterungen
bcmath, bz2, calendar, cgi-fcgi, ctype, curl, date, dba, dom, exif, filter, ftp, gd, gettext, hash, iconv, imagick, imap, json, ldap, libxml, mbstring, mcrypt, mhash, mysql, mysqli, odbc, openssl, pcre, PDO, pdo_mysql, PDO_ODBC, pdo_sqlite, posix, pspell, Reflection, session, SimpleXML, soap, sockets, SPL, standard, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, zlib.

# Allgemeine Einstellungen
log_errors_max_len - 1024
max_execution_time - 5
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - -1
memory_limit - 256M
post_max_size - 100M
safe_mode - Off
safe_mode_exec_dir - /usr/local/php/bin
safe_mode_gid - Off
safe_mode_include_dir -
sql.safe_mode - Off
upload_max_filesize - 100M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 100000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
safe_mode_allowed_env_vars - PHP_
safe_mode_protected_env_vars - LD_LIBRARY_PATH

Browser User-Agent String

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; de-de) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4