This repository holds the configuration and instructions for hosting a php7 development sandbox.
Currently running PHP 7.3 on CentOS 7.6
- install VirtualBox 5.2.30
- install Vagrant 2.2.4
- on Windows 7 SP1 ONLY you will have to update PowerShell to version 3 or above for Vagrant
- run cmd as admin
- cd to directory with this repo
vagrant up
- install putty
- connect to 192.168.56.2 port 22 as vagrant/vagrant
- verified working in chrome/firefox
- verified working in chrome/firefox
phpunit
- there is an alias in the .bash_profile so that you can run phpunit from any directory
phpunit-coverage
- there is an alias in the .bash_profile so that you can run phpunit from any directory
- See /sandbox/docs/index.html for results
XDebug has already been configured with remote_autostart enabled in the vm (/etc/php.d/xdebug.ini)
- install Visual Studio Code
- install Visual Studio Code PHP plugins including PHP Debug
- Update the launch.json file in the workspace to include the following. "${workspaceRoot}/sandbox-php7" might need to be set differently depending on the relative path of your sandbox workspace to the Visual Studio Code workspace.
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/sandbox": "${workspaceRoot}/sandbox-php7"
}
}
- Set the debugger to Listen for XDebug
- Set a breakpoint and go!
composer install --optimize-autoloader
- run composer commands from /sandbox