Installing via PECL didn’t really work out for me. So, here is what I did:
- Install Xcode if you don’t have it
- Download & install XAMPP for Mac developer package
- You will need the PHP header files. Create a symlink:
ln -s /Applications/XAMPP/xamppfiles/lib /Applications/XAMPP/xamppfiles/include
- Download the module here: http://pecl.php.net/get/oauth
- Unpack
- Run phpize:
sudo /Applications/XAMPP/xamppfiles/bin/phpize
- Configure with the following command:
sudo MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config
- Run
sudo make
- Copy the module to your extension directory
sudo cp modules/oauth.so /Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/
- Enable the module by adding this to your php.ini:
extension=oauth.so
- Restart apache and run
phpinfo()
to see if it’s working