By Matt Butcher
pecl
Debugging your PHP Code: XDebug on MAMP with TextMate and MacGDBp Support
Submitted by matt on Mon, 2009-03-16 21:51
As I see it, there are two major drawbacks to the otherwise-spectacular MAMP (MacOS Apache MySQL, PHP) package (three if you count the funky directory structuring):
- The .h files are all missing, so PECL doesn't work very well.
- There is no debugger.
The first issue is covered elsewhere. In this article, I will address the second by explaining how to setup XDebug on MAMP. XDebug is one of the two popular PHP debugging engines (With ZendDB being the other).
In this article we will cover the following:
- Getting and installing XDebug
- Using XDebug for basic stack tracing
- Integrating XDebug with TextMate
- Configuring XDebug and MacGDBp for client/server debugging
- Using MacGDBp
PHP 5 Runkit for MAMP 1.7.2
Submitted by matt on Sun, 2009-03-15 19:31Ever tried to get PHP's Runkit PECL extension running on the popular MAMP stack for Mac OS X? If you have tried, you will understand why it is difficult. There are two roadblocks that must be overcome before Runkit can be installed.
The first has to do with MAMP itself. While MAMP provides most of the tools that a web developer needs, it is generally incapable of dealing with PECL builds. The reason for this is simple: MAMP does not ship with header files for PHP. That means that extensions built from C source files cannot successfully compile. That is a problem.
The second difficulty has to do with Runkit, which (being basically feature complete) hasn't undergone a major revision in a couple of years. The official released version, in fact, will not run on PHP 5.2. Yes, that is the version that ships with MAMP. To get the fixed version, you will need to check out the latest source code from PHP.net's CVS repository and build it yourself.
Recently, I found a situation that demanded Runkit. (Okay, it might have been a contrived situation.) To accomplish the goal of my project, I built Runkit from source. If you want it, the runkit.so file is attached at the end of this post.








Recent comments
2 days 6 hours ago
3 days 6 hours ago
3 days 16 hours ago
3 days 16 hours ago
4 days 23 hours ago
5 days 18 hours ago
6 days 18 hours ago
1 week 15 hours ago
1 week 3 days ago
2 weeks 2 days ago