January 2013

Install php-libevent on OS X [solved]

I’m experimenting with Ratchet, a websocket server written in PHP. I wanted to install lib-event for PHP because according to this thread it works better than PHP’s choose_stream function. It ended up being a pain: port install libevent worked but when I ran pecl install channel://pecl.php.net/libevent-0.0.5 it could not find the libevent headers even when I pointed it to /opt/local/lib/, which is where port contents libevent said it was installed.

I ended up following this tutorial on compiling it from source and then pointing the pecl installer to that library and it worked. Mostly. Compiling it from source put it in /usr/local/lib, which the pecl installer liked better. Then it was a question of enabling it in PHP.

OS X’s php.ini installed here:


MacPort’s PHP is installed here:


Unless you change your default setup, apache will serve pages with OS X’s PHP, while the command line will serve pages with MacPort’s PHP.

Most of my OS X PHP extensions are installed here:


Most of my Mac Port PHP extensions are installed here:


I had to copy libevent.so from my mac’s extension directory to the macports extension directory, and add extension=libevent.so to both php.ini files.

ReFit hangs on windows logo [Solved]

My ReFit was hanging on the windows logo on my macbook pro when I would boot into windows.

I was having problems with windows explorer crashing every 5 seconds anyway so I plugged in my boot thumbdrive and reset (reformatted) windows.

However, refit would STILL hang on the windows logo even after a clean install. If I held down option when booting I could use Apple’s menu to get to Windows, but not via Refit.

Finally, I tried unplugging everything from my macbook, including the external mouse, SD card, and external monitor.

Now it boots fine! Hopefully this saves someone from reformatting like I did when it was just a hardware conflict. I have read other reports of USB hubs and other peripherals also causing refit to hang.