2
When I start Debugger php7.0 CLI with this php.ini setting:
;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 enters the if and arrives at header('Location:login.php'); but does not go to the login.php page. Instead gets out of parole if passing through the includes reaching the end of the file. Does not direct to the " include $fullpath; ".
It is worth remembering that in normal execution the program works 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’s installed the part.
( explaining that part - I installed Lampp that comes with Mysql, apache and Proftpd together. In the search for a debugger I found the instructions to download php5.1 made $ sudo apt-get install php5-Xdebug configured php.ini as reported in http://www.diogomatheus.com.br/blog/php/depuracao-de-aplicacoes-php-com-xdebug/ . Only then I realized that in reality I am with two Apaches one called Apache and the other Apache2, if I understood correctly. The thing is that I am with two php.ini, however I took care to configure both 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";
}
?>
include $fullpath is on the body. I include include the top.php include which is where the menu is. Then the "body" of the site and then the post buttom.php that is the footer. Basically I just change the contents of the middle page of the site.
– user65509
Just one thing. How to test the site by the Debugger? I have a problem loading some items and I would like to debug all the steps until you arrive at the page with the problem. This is impossible in php ? In java it is soft to walk all over the code, step by step. Already in php ....
– user65509
Call to where Gabriel?
– user65509
It refers to the right button in index.php -> debug as -> php CLI application ? It follows github if you want to be more. https://github.com/FabianoSouzaPereira/myschool.com.br
– user65509
I ended up traveling here, which IDE are you using? I haven’t touched xDebugger in a while. I will run some tests later to understand why.
– Gabriel Heming
Eclipse Java EE IDE for Web Developers. Version: Oxygen.1a Release (4.7.1a) Build id: 20171005-1200
– user65509
@Fabianodesouzapereira sorry for the delay, but I could not find relationship between Xdebug and the problem you present with the
include
/require
. I couldn’t find any configuration that could compromise this, so I believe it is the form (or IDE) you are using. Maybe try another, like Phpstorm, Netbean or Zendstudio to see if the same occurs. As your question was more focused on the header, I believe that your question may/should be another question.– Gabriel Heming