Friday, January 4, 2013

Compiling mongo.so for use with MAMP

So I had a little bit of trouble getting the latest version of the PHP driver for MongoDB (1.3.2) to use with MAMP. The PHP documentation's direction for MAMP users is to go to https://github.com/mongodb/mongo-php-driver/downloads and download the latest OSX driver for your PHP version (I'm using 5.3.6), which happens to be 1.0.1.1 from two years ago. Unfortunately the documentation on php.net for MongoDB has been updated, and if you aren't using the latest driver, you might be getting errors indicating that some classes don't exist.

Other instructions indicate you can just run
sudo pecl install mongo
Or
sudo pecl upgrade mongo
But this seemed to be for those using the XAMPP Developer Package. I was having trouble compiling an updated mongo.so file because my MAMP php installation was missing the necessary header files. I would get this error:
fatal error: 'php.h' file not found
#include <php .h>
         ^
1 error generated.
make: *** [php_mongo.lo] Error 1
ERROR: `make' failed
I noticed when it tried to run phpize it couldn't find any of these:
grep: /Applications/MAMP/bin/php/php5.3.6/include/php/main/php.h: No such file or directory

grep: /Applications/MAMP/bin/php/php5.3.6/include/php/Zend/zend_modules.h: No such file or directory

grep: /Applications/MAMP/bin/php/php5.3.6/include/php/Zend/zend_extensions.h: No such file or directory
So I ran locate on them, and they did exist in Xcode:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/include/php/main/php.h

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/include/php/Zend/zend.h
I tried copying the whole /include/php directory to my php directory in MAMP. I had to make an include folder in /Applications/MAMP/bin/php/php5.3.6/
cp -r /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/php /Applications/MAMP/bin/php/php5.3.6/include
When I ran 'sudo pecl upgrade mongo' it completed. I just had to restart apache/mysql and phpinfo() showed I was now using the 1.3.2 MongoDB driver.

Friday, March 11, 2011

Beery Eyed

I used to write about beer occasionally in this space. I have heard hundreds, nay, thousands of complaints about how those posts have disappeared. Well they're not gone, they've just moved. I decided to launch a beer site! BeeryEyed.com is where you can find them. I'm still working on format and what not, but you can go there to read about how I enjoy beer. Hopefully there will be more things to check out in the future.

Tuesday, March 1, 2011

Charlie Sheen Is My Hero

I never knew this, but Charlie Sheen is out of his mind. Or is he? I always figured he just loved to party harder than anyone on Earth. Either way he's hitting the peak of his career giving sensational interviews to every media outlet in existence. People will be quoting him for a while with all the material he's spewed. The best part is that it's all about winning, and nobody wins like Charlie Sheen.

Saturday, February 5, 2011

Juliet, Naked

This was the first book I've read by Nick Hornby. I have seen only one movie based on one of his books, High Fidelity, and really liked it, so after additional recommendation I thought I'd give one of his books a try. Juliet, Naked centers around Annie, Duncan and Tucker Crowe and their intertwining relationships. Tucker wrote an album, Juliet, in the 80s and promptly quit his tour to lead a reclusive life. The album earned him a cult following of which Duncan is the ring leader and he dragged Annie along with him. All of them have regrets about life over the last 15 to 20 years and the book deals with the struggles of never getting that time back.

Duncan is a character I can love to hate. A pretentious know-it-all devotee to Crowe, he spends his life trying to dissect every element of Tucker's life. He goes as far as traveling to America to visit all the places significant to the production of Juliet, marveling at a urinal which he believes played a significant role in the abrupt end of Crowe's career. When he isn't examining his bootleg albums, he's analyzing theories on the Internet about Crowe's personal life. This isn't wrong in and of itself, necessarily, it's more that his opinions and interpretations are, to him, fact, as he is the expert and nobody would know better than him.

All in all, it's a humorous, and sometimes touching story about people trying to figure out how their own lives have passed them by without having done anything of true significance, what they should or could have done differently to avoid it, and how to make up for time lost. I thoroughly enjoyed the book, it reads quickly, it revolves around music, and the characters are all flawed, but possess redeeming qualities. I'll give it a 4 out of 5 and put more of Hornby's books on my list of "To read."

Monday, January 24, 2011

You Shall Know Our Velocity! (Updated for Sacrament)

Maggie's parents gave this hardcover edition to me for Christmas, which was pretty exciting. I didn't ask for this book specifically, just books by Dave Eggers, but I'm glad I got this one. I was told there was some addition made to the paperback, I'll have to look into that because I'm told it changes the story quite a bit.

I just finished this, and it was a hard one to put down, unlike Never Let Me Go. I read this in sort of a glum, monotone voice from the narrator, Will. I'm not sure if that was accurate of me, but Will always seems lost in thought and the real world rarely excited him, like he was just an observer, or maybe nothing understood him or his situation.

Eggers made it easy for me to relate to Will, always having conversations with other people or objects in his head. I like the idea of the spontaneous world traveling, though under the circumstances it was rather sad.