laravel / homestead

MIT License
3.86k stars 1.45k forks source link

Question: How to enable Xdebug #1536

Closed ukenpachi closed 3 years ago

ukenpachi commented 3 years ago

Please note that the Homestead issue tracker is reserved for bug reports and enhancements. We are not always able to debug Vagrant, Provider or Operating System issues, but will do our best to help. Thank you!

Versions

Host operating system

Windows 10

Homestead.yaml

--- 
authorize: ~/.ssh/id_rsa.pub
cpus: 1
databases: 
  - lumen
folders: 
  - 
    map: C:\projects\umen
    to: /home/vagrant/code/api
ip: "192.168.10.10"
keys: 
  - ~/.ssh/id_rsa
memory: 2048
provider: virtualbox
sites: 
  - 
    map: lumen.local
    to: /home/vagrant/code/lumen-api/public

Having issues enabling xdebug I have done the sudo nano /etc/php/7.4/fpm/conf.d/20-xdebug.ini

xdebug.remote_autostart=1
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.scream = 0
xdebug.cli_color = 1
xdebug.show_local_vars = 1
xdebug.idekey="PHPSTORM"

in my application did `phpinfo(); xdebug is not enabled.

I tried sudo phpenmod xdebug and then php -v and xdebug still not enabled.

I downloaded old school xampp and then in ther php.ini file, enabled xdebug and it does show. So I am thinking what am I doing wrong?

svpernova09 commented 3 years ago

You don't need to do anything in Homestead to get xdebug working via Apache/nginx. Just create your configuration in your IDE and make sure you map your folders to the paths in Homestead.

ukenpachi commented 3 years ago

You don't need to do anything in Homestead to get xdebug working via Apache/nginx. Just create your configuration in your IDE and make sure you map your folders to the paths in Homestead.

this doesnt work. I have tried. Done the mapping to the vagrant project directory, etc. I have tried alot of set up steps spends 8 hours trying different solutions and destroy the box a few times in the process and still nothing. Has soon as I use xampp or wampserver. It works by me just added


[xdebug]
zend_extension="PATH/TO/xdebug.so"
xdebug.remote_autostart=1
xdebug.default_enable=1
xdebug.remote_port=9001
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_enable=1
xdebug.idekey=PHPSTORM``` 

to the php.ini file and boom. Just thing the latest vagrant or homestead  set up might be broken. Because it used to work until I installed the latest vagrant and homestead.