0

I'm configured debug mode like following with PhpStorm and php.ini .

  1. PHP Buillt-in Web Server Settings
 HOST: localhost 
 PORT: 9000
 Document root: [Project root path]
 Interpreter options: artisan serve
  1. /usr/local/etc/php/7.3/conf.d/ext-xdebug.ini
    [xdebug]
    zend_extension=xdebug.so
    #zend_extension="/usr/local/Cellar/php@7.3/7.3.16/pecl/20180731/xdebug.so"
    xdebug.remote_enable=1
    xdebug.remote_port="9000"

IF I execute from Run button with PhpStorm, following messages come up at first page.

enter image description here

/usr/local/Cellar/php@7.3/7.3.16/bin/php -S localhost:9000 
-t /Users/xxxx/Works/Projects/sample_server artisan serve
[Tue Mar 31 23:37:15 2020] PHP Notice:  Undefined index: argv in /Users/xxx/Works/Projects/sample_server/vendor/symfony/console/Input/ArgvInput.php on line 49
$ php -v
PHP 7.3.16 (cli) (built: Mar 19 2020 11:20:31) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.16, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.16, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.9.4, Copyright (c) 2002-2020, by Derick Rethans

When I run php artisan serve from command line console, it works well. What else do I need to do? Please give me advice.

tajihiro
  • 2,293
  • 7
  • 39
  • 60
  • Check https://www.jetbrains.com/help/phpstorm/debugging-with-phpstorm-ultimate-guide.html and https://www.jetbrains.com/phpstorm/documentation/debugging/ **P.S.** `xdebug.remote_port="8000"` -- this is wrong -- it has to be a Xdebug port on which PhpStorm listens and not web server port. Xdebug is the one that connects to IDE and not other way around -- see xdebug.org/docs/remote – LazyOne Mar 31 '20 at 14:15
  • *"IF I execute from Run button with PhpStorm, following messages come up at first page."* What file exactly do you execute? Screenshots are very welcome in such cases. – LazyOne Mar 31 '20 at 14:16
  • I changed the port number, but it dose not work. I expect laravel first welcome page comes up. – tajihiro Mar 31 '20 at 14:21
  • I added Error stack trace. – tajihiro Mar 31 '20 at 14:38
  • *"...-S localhost:9000..."* No, you misunderstood it completely. Better describe what are you trying to do and provide screenshots. – LazyOne Mar 31 '20 at 14:45
  • Now my all settings are port 9000. Sorry for mixed up. – tajihiro Mar 31 '20 at 14:46
  • I would like to execute debug at port 9000. And I would like to debug with PhpStorm. – tajihiro Mar 31 '20 at 14:50
  • I say: 1) just run `php artisan serve` in console as you would normally do 2) then use "Zero config" approach to execute and debug your web pages when you control what to debug via Xdebug browser extension. Just make sure that "phone handle" icon is enabled during that time (so IDE is listening for incoming debug connections) https://www.jetbrains.com/help/phpstorm/zero-configuration-debugging.html . Grab some Larvel + PhpStorm tutorial and follow it. To start with: https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/19 – LazyOne Mar 31 '20 at 14:52
  • Is it problem if 1 `php artisan serve` port is 8000, but the others port settings are 9000? – tajihiro Mar 31 '20 at 15:01
  • 1
    Web server port should be DIFFERENT to Xdebug port -- as they used for completely different purposes. With web server, you (browser) connect to server, with Xdebug it's other way around -- Xdebug connects to IDE. If you use the same port for both .. then Xdebug will simply be trying to connect to web server instead of IDE. Just use defaults (well, can use 9001 instead of 9000 for Xdebug (in both PhpStorm and php.ini) and follow some guide (start with that Laracast episode etc). – LazyOne Mar 31 '20 at 15:05
  • Now I understand. The settings were not wrong. Thank you. – tajihiro Mar 31 '20 at 15:30

0 Answers0