Skip to content
Mark edited this page Oct 12, 2023 · 6 revisions

CakePHP version map

CakephpWhoops plugin branch CakePHP core PHP min
0.x [EOL] cake3 3.x PHP 5.6
1.x cake4 4.x PHP 7.2
2.x master 5.x PHP 8.1

Setup for Linux

Arch Linux

Install the package aur/phpstorm-url-handler. See below for Firefox.

General instructions

This was tested on Linux Mint but should apply for any modern desktop. Please feel free to add instructions for your distribution, e.g. Ubuntu.

First test if your PHPStorm version can open files via CLI. For that you just find your path to the installed PHPStorm folder and try to open a file on a specific line:

/locale/path/to/PhpStorm/bin/phpstorm.sh --line {line} {filepath}

It should jump to your IDE and open exactly that line.

Note that the file path has to be an absolute path on your host system (not inside any VM).

Create a handler file

This will serve the incoming browser click and execute the above sh script.

#!/usr/bin/env bash
# PhpStorm URL Handler
#
# phpstorm://open?file=@file&line=@line
# Adapted from https://github.com/sanduhrs/phpstorm-url-handler
#
# @license GPL
# @author Stefan Auditor <stefan.auditor@erdfisch.de>
arg=${1}
# Get the file path.
file=$(echo "${arg}" | sed -r 's/.*file=(.*)&line=.*/\1/')
# Get the line number.
line=$(echo "${arg}" | sed -r 's/.*file=.*&line=(.*)/\1/')
/locale/path/to/PhpStorm/bin/phpstorm.sh --line "${line}" "${file}"

Note: you can also use /usr/bin/env pstorm instead of the sh file (or even /usr/bin/env phpstorm on older IDE versions).

Register handler in browser

In general, you can adapt and install this .desktop file via desktop-file-install phpstorm-url-handler.desktop && update-desktop-database, or add the protocol to your browser directly (which is absolutely needed in Firefox, see below).

Firefox support

Important for Firefox is, that you enable the the phpstorm:// protocol via about:config. To enable the PHPStorm protocol, add a new boolean value for network.protocol-handler.expose.phpstorm and keep the default value false.

Setup for Windows

(who wants to do that?)

Setup for MacOS

(who wants to do that?)

Further links