我正在尝试基于 CodeIgniter (2.x) 框架调试 Web 应用程序。我已经尝试过 var_dumping $_SERVER 并在调试会话开始时重新创建它(引导 phpdbg)。
$ phpdbg -e index.php
phpdbg> ev require('boostrap.php');
phpdbg> run
但是它给了我一个 404。即使通过浏览器请求页面给了我正确的结果。有人可以告诉我如何正确引导 phpdbg 以便在 codeigniter 中加载正确的页面吗?这是我的引导代码,如果有帮助的话。
<?php
$_SERVER = array (
'HTTP_USER_AGENT' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv: 38.0) Gecko/20100101 Firefox/38.0',
'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.5',
'HTTP_ACCEPT_ENCODING' => 'identity,gzip,deflate',
'HTTP_CONNECTION' => 'keep-alive',
'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
'SERVER_SIGNATURE' => '<address>Apache/2.4.12 (Ubuntu) Server at api.timzwart.local.mybit.nl Port 80</address>',
'SERVER_SOFTWARE' => 'Apache/2.4.12 (Ubuntu)',
'SERVER_NAME' => 'api.timzwart.local.mybit.nl',
'SERVER_ADDR' => '192.168.1.35',
'SERVER_PORT' => '80',
'REMOTE_ADDR' => '192.168.1.35',
'DOCUMENT_ROOT' => '/var/www/vhosts/api.timzwart.local.mybit.nl',
'REQUEST_SCHEME' => 'http',
'CONTEXT_PREFIX' => '',
'CONTEXT_DOCUMENT_ROOT' => '/var/www/vhosts/api.timzwart.local.mybit.nl',
'SERVER_ADMIN' => 'webmaster@localhost',
'SCRIPT_FILENAME' => '/var/www/vhosts/api.timzwart.local.mybit.nl/index.php',
'REMOTE_PORT' => '40706',
'GATEWAY_INTERFACE' => 'CGI/1.1',
'SERVER_PROTOCOL' => 'HTTP/1.0',
'REQUEST_METHOD' => 'GET',
'QUERY_STRING' => '',
'REQUEST_URI' => '/events/185151',
'SCRIPT_NAME' => '/index.php',
'PATH_INFO' => '/events/185151',
'PATH_TRANSLATED' => 'redirect:/index.php/events/185151/185151',
'PHP_SELF' => '/index.php/events/185151',
'REQUEST_TIME_FLOAT' => 1435128205.281,
'REQUEST_TIME' => 1435128205,
'REDIRECT_URL' => '/events/185151',
'REQUEST_URI' => '/events/185151',
'argv' => array('events','185151'),
);
?>