I am debugging a simple index.php with parse errors:
<?php
echo '<h1> Hello </h1>';
$value = 0;
if($value == 0){
echo "true";
}else{
echo "false"
}
I have configured the php-debug/Xdebug on my Ubuntu, with the settings read from different forums, but it is not working as I would like it to.
It does not load the local variables, instead opens a server.php.
Chrome shows : 502 Bad Gateway.
Has anybody come across this error?
INSTALLATION DETAILS
OS Description: Ubuntu 16.04.4 LTS Release: 16.04 Codename: xenial
phpinfo() parsed by Xdebug
Xdebug installed: 2.6.1
Server API: Command Line Interface
Windows: no
Zend Server: no
PHP Version: 7.2.9-1
Zend API nr: 320170718
PHP API nr: 20170718
Debug Build: no
Thread Safe Build: no
Configuration File Path: /etc/php/7.2/cli
Configuration File: /etc/php/7.2/cli/php.ini
Extensions directory: /usr/lib/php/20170718
Valet version 2.0.24 Current Nginx port (HTTP): 80 Current Nginx port (HTTPS): 443## Heading ##
Xdebug.ini
zend_extension=/usr/lib/php/20170718/xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9000 #if you want to change the port you can change
Launch.JSON
{ "version": "0.2.0", "configurations": [ { "name": "Listen for XDebug", "type": "php", "request": "launch", "port": 9000 }, { "name": "Launch currently open script", "type": "php", "request": "launch", "program": "${file}", "cwd": "${fileDirname}", "port":
9000 } ] }