5

I have my Laravel web app run inside Vagrant, using precise64 box.

In vagrant box: in directory /etc/apache2/sites-available , I have 000-default.conf and laratest.conf file. I'm only interested in laratest.conf right now.

Inside 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>

In my php.ini file from /etc/php5/apache2/ directory:

[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

So, I access my laravel web with laratest.dev url

In PHPStorm -> Preferences -> Project Settings -> PHP -> Servers , the image below is my setup: enter image description here

I already enable listener in PHP Debug Connection (Phone icon) and put a breakpoint. The breakpoint manage to hit when I run the web, but it give this error: enter image description here

Is there anything wrong with my set up? Especially mapping. I have tried so many things and googling, still can't debug properly yet

12
  • Visually your mappings look just fine. Question is -- 1) have you EVER renamed ANY folder in the /Users/admin/code/websites/Laratest/ path? 2) Any symbolic links (both local and especially remote) ?? 3) xdebug version Commented Mar 18, 2014 at 16:17
  • @LazyOne 1) I never rename any folder, just chmod app/storage 2) No symbolic links. But my xdebug.ini reside in '/etc/php5/mods-available/xdebug.ini', and from phpinfo(), the Additional .ini files parsed show the location in '/etc/php5/apache2/conf.d/20-xdebug.ini'.Do I need to write xdebug stuff in xdebug.ini or php.ini? 3) xdebug version 2.2.3 Commented Mar 18, 2014 at 16:32
  • 1) I suggest deleting ALL entries in "Preferences | PHP | Servers` -- on next debug connection IDE will help you to set it up correctly. See if it will work (not just for one session, but for many files/session) 2) You are receiving incoming debug connection so whatever settings are seems to work (double check xdebug section from phpinfo() output). cannot advise you the correct file to edit as I'm not using Mac/Linux myself (I just know that on some Linux distribs Apache uses different .ini file as compared to CLI one .. so always check phpinfo() in the same environment) Commented Mar 18, 2014 at 16:53
  • Based on symptoms and the fact that IDE runs on Mac (based on file paths) .. I still think about #1. Could you please go into terminal and check EVERY folder in this path there (/Users/admin/code/websites/Laratest/) -- I've seen similar behaviour before (5 or 6 times) when folder was renamed from e.g. admin to Admin (i.e. same name but different letter casing) -- in Finder it looks normal but in terminal it still has OLD casing .. and IDE fails here. Once again -- this idea is about Mac side only - does not apply to Linux Commented Mar 18, 2014 at 16:57
  • @LazyOne Everything run on linux actually (virtual box), all the path I show is located in vagrant precise64 box, only my PhpStorm reside in Mac Commented Mar 18, 2014 at 17:04

1 Answer 1

8

It turns out this is the correct mapping I needed to make it to works

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Doesn't work for group routes under prefix, take care when you want todo that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.