Unable to resolve the request "--" with chroot
gozoro opened this issue · comments
gozoro commented
What steps will reproduce the problem?
When php is launched with chroot
as:
sudo /usr/sbin/chroot /opt/php55 /usr/bin/php "$@"
and in bash, run the command:
./yii
Method \yii\console\Request::resolve() throws exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "--".'
What is the expected result?
I expected the route to resolve as "help".
What do you get instead?
This happens because $_SERVER['argv'] contains an array:
Array
(
[0] => /var/www/my_project/yii
[1] => --
)
and route resolved as NULL.
Additional info
Q | A |
---|---|
Yii version | 2.0.49 |
PHP version | 5.5 |
Operating system | Ubuntu 18.04 |
gozoro commented
Fix.
Change this line
yii2/framework/console/Request.php
Line 68 in f2ea9be
to
$route = (string)array_shift($rawParams);