Concrete cannot parse the PATH_INFO or ORIG_PATH_INFO - add me
Permalink
Hi there,
this seems to be a common problem.
And yes I was stuck too.
Finaly I figured out that the problem was caused by a faulty configured server variable.
$_SERVER['SCRIPT_NAME'] contained the parent directory of my webroot.
Probably a redirect issue.
As a hotfix I added a line to the index.php
With that tweak the installer worked as expected.
Here some findings of my debug session:
The installer checks an ajax response ...
http://example.com/index.php/install/-/test_url/20/20/...
... it has to return a little JSON
At this point my server returned the install-form again, but without the css because the paths were faulty.
That led me to the solution.
Another good starting point for debugging is in
"./concrete/libraries/request.php"
As you can see the function get() tries several server variables to figure out the correct path.
Check these variables with phpinfo()
Of course the first check has to be if PATH_INFO is working at all.
As recommended in many postings related to this topic.
Hope this post will save someones time.
have a nice day
Stefan
this seems to be a common problem.
And yes I was stuck too.
Finaly I figured out that the problem was caused by a faulty configured server variable.
$_SERVER['SCRIPT_NAME'] contained the parent directory of my webroot.
Probably a redirect issue.
As a hotfix I added a line to the index.php
<?php $_SERVER['SCRIPT_NAME'] = str_replace('/the-surplus-directory', '', $_SERVER['SCRIPT_NAME']); require('concrete/dispatcher.php');
With that tweak the installer worked as expected.
Here some findings of my debug session:
The installer checks an ajax response ...
http://example.com/index.php/install/-/test_url/20/20/...
... it has to return a little JSON
{"response":40}
At this point my server returned the install-form again, but without the css because the paths were faulty.
That led me to the solution.
Another good starting point for debugging is in
"./concrete/libraries/request.php"
[...] /** * Gets a request object for the current request. Parses PATH_INFO as necessary. * @return Request */ 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'); }
Viewing 15 lines of 26 lines. View entire code block.
As you can see the function get() tries several server variables to figure out the correct path.
Check these variables with phpinfo()
Of course the first check has to be if PATH_INFO is working at all.
As recommended in many postings related to this topic.
Hope this post will save someones time.
have a nice day
Stefan
I got the phpinfo() script and pulled up that page but it has a lot of random info that means nothing to me. I am not sure what I need to be looking for and how to tell if it is correct. Any suggestions?
Thanks
Thanks
Concrete5 relies on PATH_INFO enabled.
steps to check this:
1. put a file "phpinfo.php" in your webroot
This file should contain
2. try it with your browser
http://example.org/phpinfo.php
"example.org" has to be exchanged with your domain of course
Now you should see the phpinfo screen, a large table with lots of information
ok so far.
3. try again but now with some random string after the script name e.g.
http://example.org/phpinfo.php/XYZ...
check if there is a table row
PATH_INFO /XYZ
(use the full text search in your browser)
if you can not find this line c5 can not be installed.
steps to check this:
1. put a file "phpinfo.php" in your webroot
This file should contain
<?php phpinfo(); ?>
2. try it with your browser
http://example.org/phpinfo.php
"example.org" has to be exchanged with your domain of course
Now you should see the phpinfo screen, a large table with lots of information
ok so far.
3. try again but now with some random string after the script name e.g.
http://example.org/phpinfo.php/XYZ...
check if there is a table row
PATH_INFO /XYZ
(use the full text search in your browser)
if you can not find this line c5 can not be installed.
Thanks, finally guidance that was easy to follow for newbie in here. I have same problem, and PATH_INFO says xyz if I go to page phpinfo.php/xyz. Still same error comes from installer.
I tried adding that other code to index.php and that didn't make a difference. It is still stuck at the install screen.
Thanks