Open up your XDebug file (possibly /etc/php.d/15-xdebug.ini
) and configure XDebug:
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.file_link_format="phpstorm://open?file=%f&line=%l"
Restart your webserver to activate XDebug.
Create a file /usr/share/applications/phpstorm.desktop
with the following contents (where PHPSTORM_HOME
is actually replaced with the path to your PhpStorm files). You can also use your own personal folder ~/.local/share/applications/
instead.
[Desktop Entry]
Terminal=false
Name=PhpStorm
Exec=PHPSTORM_HOME/bin/phpstorm.sh %u
Type=Application
Icon=PHPSTORM_HOME/bin/webide.png
X-MultipleArgs=True
MimeType=application/phpstorm;x-scheme-handler/phpstorm;
Encoding=UTF-8
Categories=Development;
Run the following command to install this new file:
sudo update-desktop-database
Open up your PHPSTORM_HOME/bin/phpstorm.sh
script and add the following to the top:
url="$1"
if [ ! -z "$1" ]
then
url=${url#*file=}
line=${url##*line=}
file=${url%%&line*}
file=${file//\%2F/\/}
set -- "--line $line $file"
fi
This will make sure that the input-parameters given by XDebug are parsed and turned into the arguments that PhpStorm actually expects.
Works for me.
@yireo What does it mean by XDebug links?