Xdebug breakpoints not working MAMP, PHPStorm

I had an issue with Xdebug not stopping at breakpoints except for the first line of code in only one of my local PHP projects.  Strangely enough xdebug_break() still worked everywhere I put it.  My first thought was that a PHPStorm project setting with the debugger was awry. After searching and trying many different php.ini settings someone suggested checking the xdebug logs for anomalies.

In your php.in file specify a Xdebug log path file and then restart apache.

  • xdebug.remote_log=/[path to where you want the log to live]/xdebug.log

After setting a breakpoint on line 7, running the script, checking the log, and seeing that my breakpoint was being registered, the only inconsistency I saw was the case in the file path.

<- breakpoint_set -i 10 -t line -f file:///Users/na/PhpstormProjects/Sample/httpdocs/index.php -n 7
-> <response xmlns=”urn:debugger_protocol_v1″ xmlns:xdebug=”http://xdebug.org/dbgp/xdebug” command=”breakpoint_set” transaction_id=”10″ id=”429140001″></response>

<- stack_get -i 11
-> <response xmlns=”urn:debugger_protocol_v1″ xmlns:xdebug=”http://xdebug.org/dbgp/xdebug” command=”stack_get” transaction_id=”11″><stack where=”{main}” level=”0″ type=”file” filename=”file:///Users/na/PhpstormProjects/sample/httpdocs/index.php” lineno=”4″></stack></response>

Turns out this particular project folder name was capitalized and others were not.  This was probably a project path setting within PHPStorm somewhere; however, I changed the folder to be all lowercase in the finder and Xdebug began working perfectly.

So if you can’t get a breakpoint to work, check the Xdebug logs and your project path names.  Hopefully this saves you from a few hours of frustration.

How to fix a 2006 Honda Civic’s Cruise Control in 30 minutes

I’ve had my 2006 Honda Civic for a while now. I don’t drive as much since graduation because I telecommute so I’ve only got 61,000 miles as of now. For the most part, it’s been good to me.  There have been a few recalls that i’ve participated in but I guess that’s what I signed up for with the first iteration of the 8th generation.  My biggest complaint that hasn’t been recalled is the bad clear coat paint job which seems to be highly reported on hondaproblems.com for my model year.  I’m in the process of taking care of that but for now, my cruise control is finally working again!

Sometime in the past year the cruise control button on my steering wheel stopped working.  It’s a mechanical switch that should stay slightly depressed when the cruise is activated.  In my case, I could still operate the cruise control if I manually held the cruise button down while driving.  That’s not fun so I thought that paying to have this fixed would be less than $100 but the dealership was asking about $250 for parts and labor which seems high to me.  With my experience building PC’s over the past decade I decided I could probably handle it myself. Turns out it’s really easy.

I found a website, bernardiparts.com, selling OEM Honda parts and they had just what I needed.  They have almost all of the OEM parts that are available when you buy your car and most come with instructions. You can usually find a coupon code by searching online for a discount.

In the process of searching for documentation on my car I came across a forum where someone had documented the process of installing steering mounted audio controls.  That post shows you how easy it is to replace the broken switch since it’s so modular.  After examining that post and using it as my guide me and buddy of mine did the repair very easily.

  1. Disconnect your battery by removing one of the terminal leads.
  2. Pop off a little 3″ x 1″ panel underneath your steering wheel with flat head screw driver. 
  3. Disconnect the yellow switch by sliding the black release and pulling apart.
  4. Remove one Torx screw on the left and right side of the steering wheel.  These two screws secure the horn switch and airbag to the wheel.  They have Loctite® on them so they may require some muscle.  Don’t strip them.  We used a power drill.
  5. Remove the airbag by pulling the steering wheel cover towards you while unplugging it.
  6. Remove the 2 phillips head screws from each spoke behind the wheel.  These support the plastic shroud on the front.
     
  7. Remove the 4 phillips head screws from the front of the wheel.  This will allow you remove the cruise control switch assembly.
  8. Unplug the cruise control switch assembly.  
  9. Replace the old switch with the new one.  If you’ve made it this far, the rest is self explanatory.
     
  10. Reverse the process to reassemble the wheel and you’re done.
After you remove the uncertainty from this repair it can be accomplished in less than 10 minutes.  I’m not sure why the dealership would charge $250 for such a simple repair. It works great and I’m glad to have the functionality again.  Also, An unintended upgrade from this process is that the new switch assembly has buttons that illuminate!
If you need more pictures, check out those provided in this forum post.

GeekDesk with Custom Ikea Top Height Adjustable Standing Desk

I set out to build a desk that could be height adjusted with the push of a button because I wanted to be able to sit or stand at any given moment.  After considering much cheaper and more expensive options I went with a custom GeekDesk build which has worked out perfectly.  It arrived fast and was easy to put together.  I was impressed by the build quality and the instructions.

GeekDesk sells the frame without the top so I decided to go the custom route and find my own.  After looking through DIY sites I found out about the Ikea countertops.  They have many options including the solid oak butcher’s block which I chose. The countertop comes with a light factory finish that I’ve decided is good enough for now.  Also, the countertop size complements the frame size perfectly. I was concerned that the frame wouldn’t be able to lift the hardwood with my electronics but it has performed like a champ.

The desk pieces cost about $800. I use it 50+ hours a week and have loved the ability to sit or stand at any given moment.  I can’t imagine not having that luxury now.  I’ve found that it’s helped with fatigue and for getting in the zone.  Also, the extra space is great for reading and writing or setting up another computer.  I highly recommend this setup if you’re looking for a sit stand option.

I added a few extras to my workspace to give me a little more room.

Desk Components

  • GeekDesk v2 large black frame only;  65″ width;  (There’s a newer frame now)
  • Ikea NUMERÄR Oak Countertop; 73 1/4 x 25 5/8″
Extras (affiliate linked)

 

Configure Windows 7 with MAMP virtual hosts and Virtual Box

I’m using MAMP Pro for local web development on OSX Lion and needed to test some javascript compatibility with IE so I booted up a virtual machine. It took me a few minutes to figure how to have the DNS resolve to my local development domains that were set up on my main OS.  I couldn’t find this tip immediately online so here it is.

If you want to be able to access your named virtual hosts that you set up on MAMP on a Windows 7 virtual machine make sure you update your hosts file on the Windows VM.

Here’s what works for me.

  1. Install MAMP Pro
  2. Setup local development host in MAMP
  3. Install Virtual Box
  4. Setup Windows 7
  5. Edit the Windows 7 hosts file
    1. Run Notepad as admin in Windows.
    2. Open C:\Windows\System32\drivers\etc\hosts
    3. Add 10.0.2.2 yourdevdomain
      • Add more if you have want.
    4. Save the file.
    5. Instance restart may be required.
If that doesn’t work, check what port Apache is running on and edit the hosts file accordingly.