sinnbeck / laravel-served

Docker version of artisan serve (with alot more)
MIT License
74 stars 13 forks source link

Setting up Laravel-served with phpstorm #30

Closed iammikek closed 3 years ago

iammikek commented 3 years ago

Hiya sinnbeck, Do you have any advice on how to set up phpstorm with Laravel-served?

I'm trying to set a remote PHP interpreter. When I select Preferences > PHP > CLI Interpreter > Add New (Docker) I cant see the image from the list.

Have you had any success with this and be able to share how to do it?

sinnbeck commented 3 years ago

Hi Mike

This is how I set it up locally :) I just quickly created a new project called laravel8 and spun it up. After that I can select it here. image

iammikek commented 3 years ago

@sinnbeck Thanks René. I'll give that a go :P

iammikek commented 3 years ago

Thanks. I've now got PHPStorm recognising the docker instance. Any tips on how to get XDebug playing? Screenshot 2021-03-05 at 21 32 35 Specifically: Screenshot 2021-03-05 at 21 34 22

sinnbeck commented 3 years ago

Start by changing the port on the left (9000,90003) to 9001. Next create a remote debug config. It requires an IDE key. Use phpinfo() to find it

iammikek commented 3 years ago

Great. switched to port 9001. I can see via phpinfo that ide_key = served. I've added this key to DBGp Proxy settings in phpstorm.

Screenshot 2021-03-06 at 10 57 57

Previously I've added autostart config to xdebug (when I've done this via vagrant). In this case, would you expect http://localhost:8095/?XDEBUG_SESSION_START=served to trigger it (if I've got listen enabled in PHPSTORM).

Can't be far off now :P

sinnbeck commented 3 years ago

Hope you got it working. I use this setup image