xdebug problem solved

Summary for those in a hurry:

If you're using xdebug on a Mac, make sure that the case-insensitive path to your source files as displayed in the finder, terminal, and PhpStorm, matches the case-sensitive 'Where' section of the Finder:Get info. Changing the case of a folder name by renaming it in the Finder does not alter the case of the folder name in the underlying path, which OS X preserves on an HFS+ file system. Any paths detected or set in PhpStorm will never match the actual low-level OS paths that are apparently being used by xdebug. The solution is to 'mv' the folder in Terminal to match the name displayed in Finder.

More detail...

I've been fighting an xdebug problem for months in PhpStorm 4 -- Nothing, and I do mean nothing, could make PhpStorm stop on a break point in any file but the first file (index.php) in my project, a web project running in a local Apache vhost on my development Mac. I could make it stop on the first line, I could make it stop on a break. I could get it to stop from the command line, from firefox or chrome, from every configuration, new project, old project. But not on a break point. I could get it to stop in any file by inserting xdebug_break(), and ultimately this is the solution I settled on. Periodically I would tinker with a setting here or there, do yet another forum search, but still no joy.

Today I finally resolved to ask for help, but I did one more forum search in case there was something new and came across this thread: http://devnet.jetbrains.net/message/5395699#5395699

Which pointed out that mappings were case sensitive. So I checked all my mappings in PhpStorm, local folder to local folder, and they were all fine. And then I remembered reading the instructions this week for setting up an Android development environment on a Mac which said:

"Android must be built on a case-sensitive file system because the  sources contain files that differ only in case. We recommend that you  build Android on a partition that has been formatted with the journaled  file system HFS+.  HFS+ is required". (I think they more specifically mean case-sensitive HFS+)

Like most folks working on a recent Mac, my disk is HFS+ case-insensitive formatted, and it turns out that according to Apple:

"The HFS+ file system is case-insensitive but also case-preserving.  Therefore, when specifying filenames and directories in your code, it is  best to assume case-sensitivity."

Lights went on, and I remembered renaming my "Sites" folder to "sites" back in the distant past. Indeed, a quick look at Get info in Finder showed that the actual path to the files that wouild not map was STILL "/Users/me/Sites/" as  far as OS X was concerned, even though it was "/Users/me/sites/" for the finder and nearly every piece of software running on my Mac.

A quick trip into terminal: $ mv Sites/ sites/ , and xdebug now stops on break points everywhere. It's possible that I could have changed the mappings everywhere, but this seemed the simplest fix.

Just thought I'd share.

Please sign in to leave a comment.