When I start the php7.0 CLI debugger with this php.ini configuration:
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite3.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
extension=pdo.so
extension=pdo_mysql.so
; XDEBUG Extension
zend_extension = "path"
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
[xdebug]
xdebug.remote_enable = On
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = On
xdebug.remote_autostart = 0
xdebug.remote_handler= "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_mode = "req"
xdebug.remote_port = 9000
[CLI Server]
; Whether the CLI web server uses ANSI color coding in its terminal output.
cli_server.color = On
The debugger goes into if and arrives at header ('location: login.php'); but it will not go to the login.php page. Instead it exits the if conditional by passing the includes statements to the end of the file. It does not point to "include $ fullpath;".
It is worth remembering that in normal execution the program works it enters the login the database returns the search is verified the veracity of the data and then access to the initial page of the program. Of course I use the apache that is installed the part.
(explaining this part - I installed Lampp that comes with Mysql, Apache and Proftpd together. In searching for a debugger I found the instructions to download php5.1 I made $ sudo apt-get install php5-xdebug I set up php. ini as informed on link . Only then I realized that in fact I am with two Apaches one named apache and the other apache2, if I understood correctly. The thing is that I'm with two php.ini, however I was careful to set the two in the same way.)
What happens to the path ignored by the debugger? Why does it ignore the header path?
?php
session_start();
if( !(isset($_SESSION['login']) && $_SESSION['login']==true) ){
header('location:login.php');
}
include 'application/dao/Connection.php';
include 'biblioteca/Conversor.php';
include 'biblioteca/Validator.php';
if( isset($_GET['page']) ){
$page = $_GET['page'];
$php='';
$class='';
$folder='';
$fullpath='';
if(strpos($page, "_")!= 0){
$vetor = explode("_", $page);
$folder = $vetor[0];
$class = $vetor[1];
}else{
$file = "";
$class = "";
}
$fullpath = "$folder/$class.php";
if(file_exists($fullpath) == false){
$fullpath = "begin.php";
}
} else {
$fullpath = "begin.php";
}
?>