我使用 precise64
框在 Vagrant 中运行我的 Laravel 网络应用程序。
在 vagrant box 中:
在目录 /etc/apache2/sites-available
中,我有 000-default.conf
和 laratest.conf
文件。我现在只对 laratest.conf
感兴趣。
在 laratest.conf 中:
<VirtualHost *:80>
ServerName laratest.dev
ServerAlias www.laratest.dev
ServerAdmin webmaster@localhost
DocumentRoot /var/www/laratest/public
<Directory /var/www/laratest/public>
Options -Indexes +FollowSymLinks
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
在 /etc/php5/apache2/
目录中的 php.ini
文件中:
[xdebug]
zend_extension="./usr/lib/php5/some-number/xdebug.so"
xdebug.default_enable=1
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.idekey="vagrant"
xdebug.remote_enable=1
xdebug.profiler_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
因此,我使用 laratest.dev
url 访问我的 laravel web
在 PHPStorm -> Preferences -> Project Settings -> PHP -> Servers
中,下图是我的设置:
我已经在 PHP 调试连接(电话图标)中启用了监听器并放置了一个断点。当我运行网络时,断点设法命中,但它给出了这个错误:
我的设置有问题吗?特别是映射。我已经尝试了很多东西和谷歌搜索,仍然无法正确调试
最佳答案
事实证明这是我需要的正确映射才能正常工作
关于php - 如何在 PhpStorm 中为在 Vagrant 中运行的 Laravel Web 应用程序正确设置 XDebug? (Mac 操作系统),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22484304/