XDebug Config: Not able to "run" Follow
First some setup:
// terminal
owner@G700:/etc/php/7.2/cli$ php -v
PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.7.0, Copyright (c) 2002-2019, by Derick Rethans
with Zend OPcache v7.2.15-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
// /etc/php/7.2/cli/php.ini
zend_extension = /usr/lib/php/20170718/xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_enable=1
xdebug.idekey=PHPSTORM
Configurations > PHP Remote Debug
Server: 127.0.0.1 port 9000 Xdebug
IDEKey: PHPstorm
With these settings the green bug icon can be clicked. But the Run button is gray/disabled. I can click "rerun" in the debugger console but it does nothing, skipping breakpoints and showing no info.
what about my configuration is wrong? I saw another tutorial that uses "PHP Web Application" But I don't see that option in the configurations window.
Phpstorm 2018.3 on Lubunti 18.04
Please sign in to leave a comment.
Could you please share the screenshot of the panel and your "Run/Debug configuration" settings window?
Ok, here it is
And here is the config:
Please don't use Run/Debug configurations for web debugging.
Check this guide: https://www.jetbrains.com/help/phpstorm/zero-configuration-debugging.html
Basically, you need to install an Xdebug extension into your browser (or use bookmarklets), and you're good to go.
By the way, the config you are trying to use doesn't work because 127.0.0.0 is not a real address, and instead of Xdebug port it's supposed to be your web server's port there.
I did the first steps, including enabling Xdebug, setting a breakpoint in a php file in my project, using the chrome Xdebug extension set to the "debug" setting (green) and reloading the page, and restarting phpstorm. The following step is where I'm stuck:
Start the debugging session #
Reload the page in the browser and return to PhpStorm. In the Incoming Connection From <Debugging Engine> dialog, select the path mappings so that PhpStorm can map the remote files on the web server to the local files in your project. If you have a deployment configuration defined, PhpStorm will offer to configure the mappings based on the paths you've already set in that configuration.
-------------
There is no prompt for an incoming connection.
I should also note that Phpstorm has updated to 2019.1. Still on Lubuntu 18.04
Oh, there's one more thing I didn't pay attention to intitially - you edited the CLI-related php.ini, it's settings won't be applied to the web server.
Please execute phpinfo() with your web server and check if Xdebug is also enabled there (just text search for xdebug on the phpinfo() page).
ok, searching for xdebug I got this. I'm not sure if this is enough
// headers, apache settings for Cookie
HTTP_COOKIE Phpstorm-280abd05=9a734f99-bdd9-44b8-9481-f7c7f9a87427; connect.sid=s%3AhcqV9bOU9EB12Hf6Tccqc5uszqPvjoy0.EDDHN%2FGUd7M%2FTObhFzAxU4wwv%2BKBURyMBDm1jy%2BtuYo; XDEBUG_SESSION=XDEBUG_ECLIPSE; io=CI2LMHyytFzaI_geAAGA
// under PHP Variables section
$_COOKIE['XDEBUG_SESSION'] XDEBUG_ECLIPSE
php -i
output doesn't necessarily mean 1) that you're using the same interpreter for your web server 2) that web server uses the same php.ini as CLI does.Please put a .php file with
<?php phpinfo();
into the web root of your web server and open this page with your browser.Sorry, I realized that and revised my last post. It now has info about what phpinfo(); returned.
Here's the whole thing
PHP Version 7.2.15-0ubuntu0.18.04.1
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
Configuration
apache2handler
Apache Environment
HTTP Headers Information
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
Phar
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib
Additional Modules
Environment
PHP Variables
PHP Credits
PHP License
This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
That is what I meant - there's no Xdebug enabled for your web server.
Please add these to
/etc/php/7.2/apache2/php.ini
:Then restart Apache and check how it goes.
Just got a note on the bottom right of PhpStorm:
"Can not accept Xdebug Connection"
Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'
Looks like its working now, thank you for guiding me through it!
Looks like it is somewhat working, with issues. I still get this popup error on the lower right:
Can not accept external Xdebug connection
Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'
Also in the debugger, multiple tabs for the same file open automatically in 3-5 minute intervals
Looks like some other host/service tries to connect or you have a cron job that reset connection as described here: https://youtrack.jetbrains.com/issue/WI-19012#focus=streamItem-27-709332.0-0
Try changing Debug port to e.g. 9002 in /etc/php/7.2/apache2/php.ini (xdebug.remote_port=9002) and in File | Settings | Languages & Frameworks | PHP | Debug.