Debug going to first line of index.php - script is outside the project Follow
I set up Xdebug for a project I am working on. The debugging was working great for many weeks. Just recently, I added my code to SVN and then I deleted the PHPStorm project and recreated it. After that, debugging worked briefly but then stopped working. Instead of stopping at the breakpoint, the code execution stops at the first line of index.php.
The error I am seeing is "The script '/Applications/XAMPP/htdocs/myproject/index.php' is outside the project". There is also a link "Click to set up path mappings." When I click this link, I set the path mappings as follows: File path on server: '/Applications/XAMPP/xamppfiles/htdocs/myproject/index.php' File path in project: '/Applications/XAMPP/xamppfiles/htdocs/myproject/index.php'. This does not fix the problem.
Any ideas on what I might be doing wrong? The debugging works the first time I run it after creating a project, and then it breaks as described above.
Setup:
Mac OSX 10.7
PHPStorm 4.0.2
XAMPP
Xdebug 2.2.0-dev-komodo
Source code path:
/Applications/XAMPP/htdocs/myproject/
Include paths:
/Applications/XAMPP/xamppfiles/lib/php
/Applications/XAMPP/xamppfiles/lib/php/pear
/Applications/XAMPP/htdocs/yii
Please sign in to leave a comment.
This does not appear to be an Xdebug issue, because I tried using ZendDebugger and I get the same error.
It appears that this is a path mapping problem, as XAMPP is using symbolic links as follows:
/Applications/XAMPP stephen$ ls -lh
total 32
drwxr-xr-x 3 admin admin 102B Feb 27 2010 XAMPP Control.app
lrwxr-xr-x 1 admin admin 18B Feb 27 2010 cgi-bin -> xamppfiles/cgi-bin
lrwxr-xr-x 1 admin admin 14B Feb 27 2010 etc -> xamppfiles/etc
lrwxr-xr-x 1 admin admin 17B Feb 27 2010 htdocs -> xamppfiles/htdocs
lrwxr-xr-x 1 admin admin 15B Feb 27 2010 logs -> xamppfiles/logs
drwxr-xr-x@ 23 root admin 782B Feb 27 2010 xamppfiles
Is there a way to correct the path mapping for the whole directory?
Hi Stephen,
Yes -- assign correct path mapping for a directory and not the individual file.
I got it working, although it took me forever to figure this out.
1) Go to Preferences>Project Settings>PHP and add a PHP include path "/Applications/XAMPP/htdocs/yii".
2) Go to Preferences>Project Settings>PHP>Server and enable path mapping for the server. Create the following path mapping: "/Applications/XAMPP/htdocs/yii" -> "/Applications/XAMPP/xamppfiles/htdocs/yii".