Xdebug on Vagrant Scotchbox running PHP 7.2 - Config

112
June 29, 2019, at 03:10 AM

Not a question, but wanted to share with you the config i've used to get xDebug working on Vagrant using Scotchbox with PHP 7.2.

I had issues getting xDebug working with scotchbox and found many pother articles providing suggested configuration but none worked for me.

This was my process:

  • vagrant ssh
  • sudo pecl install xdebug. if errors read the advice given.
  • it says to add ../xdebug.so" to php.ini. copy this line, ie: zend_extension=/usr/lib/php/20170718/xdebug.so
  • sudo nano /etc/php/7.2/apache2/php.ini
  • scroll to bottom > paste:

    [XDebug] sudo nano /etc/php/7.2/apache2/php.ini xdebug.remote_enable = 1 xdebug.remote_autostart = 1 xdebug.remote_connect_back = 1 xdebug.remote_host = 192.168.33.0 xdebug.remote_port = 9000 xdebug.remote_log = /var/log/xdebug.log

  • restart apache: sudo service apache2 restart or if using https you will need sudo a2enmod ssl;sudo service apache2 restart

  • in visual studio Code > xDebug config was DEFAULT:

    { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Listen for XDebug", "type": "php", "request": "launch", "pathMappings": { "/var/www/public/": "${workspaceRoot}" }, "port": 9000, "log": true }, { "name": "Launch currently open script", "type": "php", "request": "launch", "program": "${file}", "cwd": "${fileDirname}", "port": 9000 } ] }

I hope this helps somebody as took me hours to work out :)

READ ALSO
Can't Format Date To String

Can't Format Date To String

i am trying to get some data from database inside a view

71
Loop through a list of car numbers to calculate mean of steering angle for each car

Loop through a list of car numbers to calculate mean of steering angle for each car

I am working on correcting the steering angleSteps: 1) Filter the data based on backstretchend and backstretchstart of a race track 2) Calculate the mean of existing values by per car 3) Calculate the difference between the mean calculated per car and the actual...

93
Can anything non-obvious go wrong with this Python trick?

Can anything non-obvious go wrong with this Python trick?

I frequently want a dictionary mapping keys to consecutive IDs so I do the following:

81