markdown 使用PHPStorm,Vagrant配置Xdebug

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 使用PHPStorm,Vagrant配置Xdebug相关的知识,希望对你有一定的参考价值。

## Vagrant

First, SSH into your Vagrant box
```
vagrant ssh
```
Install Xdebug for your version of PHP
```
sudo apt-get install php-xdebug
```
Edit Xdebug config file (location can vary) 
```
sudo nano /etc/php/7.0/apache2/conf.d/20-xdebug.ini
```
Paste in the below (important - change the `remote_host` to your local server)
```
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.remote_host=192.168.33.10
xdebug.idekey=PHPSTORM
```
Save, and restart Apache
```
sudo service apache2 restart
```
Verify that Xdebug is loaded correctly
```
php --version
```

## PHPStorm
Select *Run > Web Server Debug Validation*

Enter a path where the validation script should be created (anywhere - doesn't matter, but somewhere logical)

The URL to the validation script should be your local server URL. For example, since I'm running browsersync, for me this `http://localhost:3000/`

Now click *Validate* to ensure everything is working correctly. Fix any errors that are displayed.

以上是关于markdown 使用PHPStorm,Vagrant配置Xdebug的主要内容,如果未能解决你的问题,请参考以下文章

markdown phpstorm常用命令

markdown PHPStorm远程调试Docker容器

markdown PhpStorm

markdown PhpStorm热键

markdown 我不能在phpstorm中输入单/双引号

markdown Debuguear REST con Postman + xdebug + PhpStorm