php - 如何在 PhpStorm 中为在 Vagrant 中运行的 Laravel Web 应用程序正确设置 XDebug? (Mac 操作系统)

标签 php apache laravel vagrant phpstorm

我使用 precise64 框在 Vagrant 中运行我的 Laravel 网络应用程序。

在 vagrant box 中: 在目录 /etc/apache2/sites-available 中,我有 000-default.conflaratest.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 中,下图是我的设置: enter image description here

我已经在 PHP 调试连接(电话图标)中启用了监听器并放置了一个断点。当我运行网络时,断点设法命中,但它给出了这个错误: enter image description here

我的设置有问题吗?特别是映射。我已经尝试了很多东西和谷歌搜索,仍然无法正确调试

最佳答案

事实证明这是我需要的正确映射才能正常工作

enter image description here

关于php - 如何在 PhpStorm 中为在 Vagrant 中运行的 Laravel Web 应用程序正确设置 XDebug? (Mac 操作系统),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22484304/

相关文章:

php - Laravel 验证登录路径

python - Django 部署麻烦

django - 网址无效的Django 1.4导入错误语法

php - 无法在 Laravel 迁移中创建外键

laravel 5.6 护照。 postman 加载无输出

php - 返回期望的数组

php - 如果 WHERE 子句为空则忽略条件

php - 在 Laravel 5.1 中将查询生成器条件设置为模型

PHP - 连接到虚拟机中的 PostgreSQL 数据库失败

Laravel Socialite 返回错误未定义索引 : first_name