Debugging with PhpStorm
In order to set up debugging in PhpStorm, you need to allow Xdebug running on your Frontastic Machine to connect to PhpStorm.
If you're using Frontastic CLI, you can do this by using frontastic xdebug
. Alternatively, you can set up the port forwarding yourself by using ssh <user>@<host> -R 9003:localhost:9003
.
Optionally, you can set the debug connection to start automatically when you make a request. To do this, open the Xdebug config file and update the config setting to set xdebug.start_with_request to 1
. Then SSH into your development machine and use vi $(php --ini | grep xdebug | sed 's/,//')
to edit it. If you do this update, remember to restart php-fpm using sudo service php7.4-fpm restart
.
If you run into any problems you can have a look at the Xdebug log at /tmp/xdebug
Now, your PHP should be configured and you can set up PhpStorm. You'll also need to follow the below steps to run the configuration:

Then you can start debugging, to do this you'll need to follow the below steps:

PhpStorm is now listening to debug connections from your Frontastic Machine.
You just need to tell PhpStorm where you want to start debugging by setting a breakpoint. In the below example, we're just using the index.php
for this, but you could set it up for any PHP code in the Frontastic platform, including your custom PHP code.

This is required because xdebug tells PhpStorm paths to files within the Frontastic Machine. For instance, the index.php is located under /var/www/frontastic/project/public/index.php
, and on your computer, it is in a completely different location.
File Path on Server
contains the path within your Frontastic Machine. Select the corresponding file on your host below - probably the first preselected file is correct.
‹ Back to article list