Posted on Leave a comment

Install PHP intl extension using Homebrew on XAMPP

PHP Logo

Recently, when trying to install the PHP intl extension for a Symfony2 based web project using Homebrew to following error message kept showing up:

/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory /usr/local/bin/brew: line 23: /usr/local/Library/brew.rb: Undefined error: 0

This post steps explains what is needed to install PHP intl extension using Homebrew on XAMPP.

Reinstall required?

Trying to do a quick re-install did not succeed:

bash-3.2$ ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

It appears Homebrew is already installed. If your intent is to reinstall you should do the following before running this installer again:

bash-3.2$ rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup

So, basically it’s advised to remove existing files and re-start the installer which resulted in

rm: /usr/local/Cellar/libmemcached/1.0.18/AUTHORS: Permission denied

rm: /usr/local/Cellar/libmemcached/1.0.18/bin/memcapable: Permission denied

rm: /usr/local/Cellar/libmemcached/1.0.18/bin/memcat: Permission denied

… and many more errors

Sudo to the rescue?

Ok, so let’s remove the files using sudo:

bash-3.2$ sudo rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup

Password: *****

/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory

/usr/local/bin/brew: line 23: /usr/local/Library/brew.rb: Undefined error: 0

Well, this is kind of embarrassing 🙂

Since the folder have been successfully removed it might just be the brew cleanup command that causes the problems?

bash-3.2$ sudo brew cleanup

/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory

/usr/local/bin/brew: line 23: /usr/local/Library/brew.rb: Undefined error: 0

It’s not 🙂 So, after manually removing these directories again it’s time for another attempt to call the brew installer:

bash-3.2$ ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

==> This script will install:

/usr/local/bin/brew

/usr/local/Library/…

/usr/local/share/man/man1/brew.1

==> The following directories will be made group writable:

/usr/local/sbin

/usr/local/share/man/man7

Press RETURN to continue or any other key to abort

==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/sbin /usr/local/share/man/man7

==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew

==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew

==> Downloading and installing Homebrew…

remote: Counting objects: 3580, done.

remote: Compressing objects: 100% (3426/3426), done.

remote: Total 3580 (delta 35), reused 1458 (delta 18), pack-reused 0

Receiving objects: 100% (3580/3580), 2.74 MiB | 963.00 KiB/s, done.

Resolving deltas: 100% (35/35), done.

From https://github.com/Homebrew/homebrew

* [new branch]      master     -> origin/master

error: unable to unlink old ‘Library/Homebrew/extend/ENV/shared.rb’ (Permission denied)

error: unable to unlink old ‘Library/Homebrew/extend/ENV/std.rb’ (Permission denied)

error: unable to unlink old ‘Library/Homebrew/extend/ENV/super.rb’ (Permission denied)

error: unable to unlink old ‘Library/Homebrew/hooks/bottles.rb’ (Permission denied)

error: unable to create file Library/Homebrew/language/go.rb (Permission denied)

error: unable to unlink old ‘Library/Homebrew/language/haskell.rb’ (Permission denied)

error: unable to create file Library/Homebrew/language/java.rb (Permission denied)

error: unable to unlink old ‘Library/Homebrew/language/python.rb’ (Permission denied)

error: unable to create file Library/Homebrew/utils/fork.rb (Permission denied)

error: unable to unlink old ‘Library/Homebrew/utils/inreplace.rb’ (Permission denied)

error: unable to unlink old ‘Library/Homebrew/utils/json.rb’ (Permission denied)

error: unable to create file Library/Homebrew/utils/popen.rb (Permission denied)

error: unable to unlink old ‘Library/Homebrew/vendor/okjson.rb’ (Permission denied)

Checking out files: 100% (3584/3584), done.

fatal: Could not reset index file to revision ‘origin/master’.

Failed during: git reset –hard origin/master

Almost! As you can see we also need to manually remove the Library/Homebrew folder and finally it works:

bash-3.2$ ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

==> This script will install:

/usr/local/bin/brew

/usr/local/Library/…

/usr/local/share/man/man1/brew.1

Press RETURN to continue or any other key to abort

==> Downloading and installing Homebrew…

remote: Counting objects: 3580, done.

remote: Compressing objects: 100% (3426/3426), done.

remote: Total 3580 (delta 35), reused 1458 (delta 18), pack-reused 0

Receiving objects: 100% (3580/3580), 2.74 MiB | 502.00 KiB/s, done.

Resolving deltas: 100% (35/35), done.

From https://github.com/Homebrew/homebrew

* [new branch]      master     -> origin/master

HEAD is now at f45116a swiftlint: add 0.1.0 bottle.

==> Installation successful!

==> Next steps

Run `brew help` to get started

bash-3.2$ brew help

Example usage:

  brew [info | home | options ] [FORMULA…]

  brew install FORMULA…

  brew uninstall FORMULA…

  brew search [foo]

  brew list [FORMULA…]

  brew update

  brew upgrade [–all | FORMULA…]

  brew pin/unpin [FORMULA…]

Troubleshooting:

  brew doctor

  brew install -vd FORMULA

  brew [–env | config]

Brewing:

  brew create [URL [–no-fetch]]

  brew edit [FORMULA…]

  open https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md

Further help:

  man brew

  brew home

Pretty easy, right? 😉 Now it’s time to actually install the PHP intl extension.

Install PHP intl extension using Homebrew

To actually install the PHP intl extension we can use Homebrew, thanks to Gigamike for the tip:

bash-3.2$ brew install icu4c

==> Downloading https://homebrew.bintray.com/bottles/icu4c-55.1.yosemite.bottle.tar.gz

######################################################################## 100,0%

==> Pouring icu4c-55.1.yosemite.bottle.tar.gz

==> Caveats

This formula is keg-only, which means it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in

parallel can cause all kinds of trouble.

OS X provides libicucore.dylib (but nothing else).

Generally there are no consequences of this for you. If you build your

own software and it requires this formula, you’ll need to add to your

build variables:

    LDFLAGS:  -L/usr/local/opt/icu4c/lib

    CPPFLAGS: -I/usr/local/opt/icu4c/include

==> Summary

🍺  /usr/local/Cellar/icu4c/55.1: 244 files, 66M

And then finally install intl:

bash-3.2$ sudo /Applications/XAMPP/xamppfiles/bin/pecl install intl

Cannot find autoconf phpize failed

In case you get an error Cannot find autoconf

bash-3.2$ sudo /Applications/XAMPP/xamppfiles/bin/pecl install intl

downloading intl-3.0.0.tgz …

Starting to download intl-3.0.0.tgz (248,200 bytes)

…………………………………………….done: 248,200 bytes

150 source files, building

running: phpize

Configuring for:

PHP Api Version:         20121113

Zend Module Api No:      20121212

Zend Extension Api No:   220121212

Cannot find autoconf. Please check your autoconf installation and the

$PHP_AUTOCONF environment variable. Then, rerun this script.

ERROR: `phpize’ failed

make sure that autoconf is installed and PHP_AUTOCONF is set correctly (which is not set by default when using XAMPP).

You can easily install autoconf through Homebrew too:

bash-3.2$ brew install autoconf

==> Downloading https://homebrew.bintray.com/bottles/autoconf-2.69.yosemite.bottle.1.tar.gz

######################################################################## 100,0%

==> Pouring autoconf-2.69.yosemite.bottle.1.tar.gz

Warning: This keg was marked linked already, continuing anyway

🍺  /usr/local/Cellar/autoconf/2.69: 70 files, 3,1M

Next, make sure that PHP_AUTOCONF is in your path by checking the path to autoconf:

bash-3.2$ which autoconf

/usr/local/bin/autoconf

 Now set PHP_AUTOCONF:

bash-3.2$ export PHP_AUTOCONF=/usr/local/bin/autoconf

and start the intl installation through PECL again:

bash-3.2$ sudo /Applications/XAMPP/xamppfiles/bin/pecl install intl

downloading intl-3.0.0.tgz …

Starting to download intl-3.0.0.tgz (248,200 bytes)

…………………………………………….done: 248,200 bytes

150 source files, building

running: phpize

Configuring for:

PHP Api Version:         20121113

Zend Module Api No:      20121212

Zend Extension Api No:   220121212

Specify where ICU libraries and headers can be found [DEFAULT] :

building in /private/tmp/pear/temp/pear-build-rootlnRgnx/intl-3.0.0

running: /private/tmp/pear/temp/intl/configure –with-icu-dir=DEFAULT

checking for grep that handles long lines and -e… /usr/bin/grep

checking for egrep… /usr/bin/grep -E

checking for a sed that does not truncate output… /usr/bin/sed

checking for cc… cc

checking whether the C compiler works… yes

checking for C compiler default output file name… a.out

checking for suffix of executables…

checking whether we are cross compiling… no

checking for suffix of object files… o

checking whether we are using the GNU C compiler… yes

checking whether cc accepts -g… yes

checking for cc option to accept ISO C89… none needed

checking how to run the C preprocessor… cc -E

checking for icc… no

checking for suncc… no

checking whether cc understands -c and -o together… yes

checking for system library directory… lib

checking if compiler supports -R… no

checking if compiler supports -Wl,-rpath,… yes

checking build system type… x86_64-apple-darwin14.3.0

checking host system type… x86_64-apple-darwin14.3.0

checking target system type… x86_64-apple-darwin14.3.0

checking for PHP prefix… /Applications/XAMPP/xamppfiles

checking for PHP includes… -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib

checking for PHP extension directory… /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212

checking for PHP installed headers prefix… /Applications/XAMPP/xamppfiles/include/php

checking if debug is enabled… no

checking if zts is enabled… no

… a lot more messages and compile output and finally:

———————————————————————-

Libraries have been installed in:

   /private/tmp/pear/temp/pear-build-rootlnRgnx/intl-3.0.0/modules

If you ever happen to want to link against installed libraries

in a given directory, LIBDIR, you must either use libtool, and

specify the full pathname of the library, or use the `-LLIBDIR’

flag during linking and do at least one of the following:

   – add LIBDIR to the `DYLD_LIBRARY_PATH’ environment variable

     during execution

See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

———————————————————————-

Build complete.

Don’t forget to run ‘make test’.

running: make INSTALL_ROOT=”/private/tmp/pear/temp/pear-build-rootlnRgnx/install-intl-3.0.0″ install

Installing shared extensions:     /private/tmp/pear/temp/pear-build-rootlnRgnx/install-intl-3.0.0/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/

running: find “/private/tmp/pear/temp/pear-build-rootlnRgnx/install-intl-3.0.0” | xargs ls -dils

10839659   0 drwxr-xr-x  3 root  wheel     102 19 Mai 14:48 /private/tmp/pear/temp/pear-build-rootlnRgnx/install-intl-3.0.0

10840601   0 drwxr-xr-x  3 root  wheel     102 19 Mai 14:48 /private/tmp/pear/temp/pear-build-rootlnRgnx/install-intl-3.0.0/Applications

10840602   0 drwxr-xr-x  3 root  wheel     102 19 Mai 14:48 /private/tmp/pear/temp/pear-build-rootlnRgnx/install-intl-3.0.0/Applications/XAMPP

10840603   0 drwxr-xr-x  3 root  wheel     102 19 Mai 14:48 /private/tmp/pear/temp/pear-build-rootlnRgnx/install-intl-3.0.0/Applications/XAMPP/xamppfiles

10840604   0 drwxr-xr-x  3 root  wheel     102 19 Mai 14:48 /private/tmp/pear/temp/pear-build-rootlnRgnx/install-intl-3.0.0/Applications/XAMPP/xamppfiles/lib

10840605   0 drwxr-xr-x  3 root  wheel     102 19 Mai 14:48 /private/tmp/pear/temp/pear-build-rootlnRgnx/install-intl-3.0.0/Applications/XAMPP/xamppfiles/lib/php

10840606   0 drwxr-xr-x  3 root  wheel     102 19 Mai 14:48 /private/tmp/pear/temp/pear-build-rootlnRgnx/install-intl-3.0.0/Applications/XAMPP/xamppfiles/lib/php/extensions

10840607   0 drwxr-xr-x  3 root  wheel     102 19 Mai 14:48 /private/tmp/pear/temp/pear-build-rootlnRgnx/install-intl-3.0.0/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212

10840608 856 -rwxr-xr-x  1 root  wheel  434572 19 Mai 14:48 /private/tmp/pear/temp/pear-build-rootlnRgnx/install-intl-3.0.0/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/intl.so

Build process completed successfully

Installing ‘/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/intl.so’

install ok: channel://pecl.php.net/intl-3.0.0

configuration option “php_ini” is not set to php.ini location

You should add “extension=intl.so” to php.ini

Activate intl Extension in php.ini

Finally, make sure to add

extension=intl.so

to your php.ini and restart Apache. If everything is set up correctly you will see the intl information using phpinfo():

PHP intl extension phpinfo

 You are all set to go!

Posted on 3 Comments

Setup Varnish Cache Server for Magento 1.9 CE on Mac OSX

Magento Logo

When dealing with high traffic Magento installations you definitely want to implement caching mechanisms to ensure proper response times for your visitors. Apart from internal caching and indexing functionality provided by Magento there exist a couple of (external) extensions that help you speed of content delivery by e.g. caching entire pages, such as PageCache for Varnish.

Simply put, Varnish represents a reverse-proxy cache that serves as entry-point into you Magento installation and returns cached content rather than requesting Magento to re-build entire pages.

The following steps show you can setup Varnish cache server for Magento 1.9 CE on Mac OSX.

First off, make sure you have Homebrew installed and configured properly. Based on Homebrew we can easily setup Varnish by issuing the following command:

bash-3.2$ brew install varnish
==> Installing varnish dependency: pkg-config
==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
######################################################################## 100,0%
==> ./configure --prefix=/usr/local/Cellar/pkg-config/0.28 --disable-host-tool --with-internal-glib --with-pc-path=/usr/local/lib/p
==> make
==> make check
==> make install
  /usr/local/Cellar/pkg-config/0.28: 10 files, 600K, built in 97 seconds
==> Installing varnish dependency: pcre
==> Downloading ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.33.tar.bz2
######################################################################## 100,0%
==> ./configure --prefix=/usr/local/Cellar/pcre/8.33 --enable-utf8 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2 --
==> make
==> make test
==> make install
   /usr/local/Cellar/pcre/8.33: 140 files, 4,1M, built in 49 seconds
==> Installing varnish
==> Downloading http://repo.varnish-cache.org/source/varnish-3.0.3.tar.gz
######################################################################## 100,0%
==> ./configure --prefix=/usr/local/Cellar/varnish/3.0.3 --localstatedir=/usr/local/var
==> make install
==> Caveats
To have launchd start varnish at login:
    ln -sfv /usr/local/opt/varnish/*.plist ~/Library/LaunchAgents
Then to load varnish now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.varnish.plist
Warning: /usr/local/sbin is not in your PATH
You can amend this by altering your ~/.bashrc file
==> Summary
 /usr/local/Cellar/varnish/3.0.3: 51 files, 1,8M, built in 43 seconds

As shown in Brew’s output you can start Varnish by issuing the following command:

==> Caveats
To have launchd start varnish at login:
    ln -sfv /usr/local/opt/varnish/*.plist ~/Library/LaunchAgents
Then to load varnish now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.varnish.plist

In case the following error occurs:

bash-3.2$ sudo launchctl load ~/Library/LaunchAgents/homebrew.mxcl.varnish.plist"
launchctl: Couldn't" stat("~/Library/LaunchAgents/homebrew.mxcl.varnish.plist"): No such file or directory nothing found to load

try a re-install first (and additionally do a brew-update/updgrade):

bash-3.2$ sudo brew uninstall varnish
Uninstalling /usr/local/Cellar/varnish/3.0.3...

After a brew update/upgrade Varnish 4.0.0 is now being installed:

bash-3.2$ sudo brew install varnish
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/varnish-4.0.0.mavericks.bottle.tar.gz
######################################################################## 100,0%
==> Pouring varnish-4.0.0.mavericks.bottle.tar.gz
==> Caveats
To have launchd start varnish at login:
    ln -sfv /usr/local/opt/varnish/*.plist ~/Library/LaunchAgents
Then to load varnish now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.varnish.plist
==> Summary
 /usr/local/Cellar/varnish/4.0.0: 93 files, 1,9M

Unfortunately, this does not fix the missing plist file problem every time.

Nevertheless, you can easily create the plist file yourself, as mentioned here https://github.com/Homebrew/homebrew/issues/15922:

Simply copy the contents for the plist file by calling brew cat varnish:

bash-3.2$ sudo brew cat varnish
require 'formula'

class Varnish < Formula
  homepage 'http://www.varnish-cache.org/'
  url 'https://repo.varnish-cache.org/source/varnish-4.0.0.tar.gz'
  sha1 '6ad4fcf42a505a748ae993cb6ed579159e023633'

  bottle do
    sha1 "190bba2cf0e521b489cbd64cc698ba769b18cccd" => :mavericks
    sha1 "fd12d468c2328179bd402f1592b65ef69d6f1baa" => :mountain_lion
    sha1 "0e9717e705541a34906947eb7e49ab800204e2ff" => :lion
  end

  depends_on 'pkg-config' => :build
  depends_on 'pcre'

  resource "docutils" do
    url "https://pypi.python.org/packages/source/d/docutils/docutils-0.11.tar.gz"
    sha1 "3894ebcbcbf8aa54ce7c3d2c8f05460544912d67"
  end

  def install
    ENV.prepend_create_path "PYTHONPATH", buildpath+"lib/python2.7/site-packages"
    resource("docutils").stage do
      system "python", "setup.py", "install", "--prefix=#{buildpath}"
    end

    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--localstatedir=#{var}",
                          "--with-rst2man=#{buildpath}/bin/rst2man.py",
                          "--with-rst2html=#{buildpath}/bin/rst2html.py"
    system "make install"
    (var+'varnish').mkpath
  end

  test do
    system "#{opt_sbin}/varnishd", "-V"
  end

  def plist; <<-EOS.undent
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
      <plist version="1.0">
      <dict>
        <key>Label</key>
        <string>#{plist_name}</string>
        <key>ProgramArguments</key>
        <array>
          <string>#{opt_sbin}/varnishd</string>
          <string>-n</string>
          <string>#{var}/varnish</string>
          <string>-f</string>
          <string>#{etc}/varnish/default.vcl</string>
          <string>-s</string>
          <string>malloc,1G</string>
          <string>-T</string>
          <string>127.0.0.1:2000</string>
          <string>-a</string>
          <string>0.0.0.0:80</string>
        </array>
        <key>KeepAlive</key>
        <true/>
        <key>RunAtLoad</key>
        <true/>
        <key>WorkingDirectory</key>
        <string>#{HOMEBREW_PREFIX}</string>
        <key>StandardErrorPath</key>
        <string>#{var}/varnish/varnish.log</string>
        <key>StandardOutPath</key>
        <string>#{var}/varnish/varnish.log</string>
      </dict>
      </plist>
    EOS
  end
end

The plist content in this case is:

<?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
      <plist version="1.0">
      <dict>
        <key>Label</key>
        <string>#{plist_name}</string>
        <key>ProgramArguments</key>
        <array>
          <string>#{opt_sbin}/varnishd</string>
          <string>-n</string>
          <string>#{var}/varnish</string>
          <string>-f</string>
          <string>#{etc}/varnish/default.vcl</string>
          <string>-s</string>
          <string>malloc,1G</string>
          <string>-T</string>
          <string>127.0.0.1:2000</string>
          <string>-a</string>
          <string>0.0.0.0:80</string>
        </array>
        <key>KeepAlive</key>
        <true/>
        <key>RunAtLoad</key>
        <true/>
        <key>WorkingDirectory</key>
        <string>#{HOMEBREW_PREFIX}</string>
        <key>StandardErrorPath</key>
        <string>#{var}/varnish/varnish.log</string>
        <key>StandardOutPath</key>
        <string>#{var}/varnish/varnish.log</string>
      </dict>
      </plist>

Now starting Varnish via launchctl succeeds:

bash-3.2$ sudo launchctl load ~/Library/LaunchAgents/homebrew.mxcl.varnish.plist

Time to test the service

Open a browser and navigate to 127.0.0.1:8080 (which is the port Varnish is listening to set by the configuration in the plist file from above) and check out the headers:

Accept-Ranges	bytes, bytes
Age	0
Connection	keep-alive
Content-Language	de
Content-Length	1087
Content-Type	text/html; charset=utf-8
Date	Fri, 30 May 2014 07:31:12 GMT
Server	Apache/2.4.4 (Unix) PHP/5.4.7 OpenSSL/1.0.1e
Vary	accept-language,accept-charset
Via	1.1 varnish
X-Varnish	1661470811

Congratulations, as you can see Varnish is working properly!

The next step is to configure Apache to listen to port 8080 (or any other port apart from 80) and Varnish on port 80.

That’s it 🙂

Posted on Leave a comment

Installing OAuth PECL extension for XAMPP beta on Mac

Recently I ran into problems when installing OAuth PECL extension for XAMPP beta on Mac OS-X. Running pecl from the command line gave the following error:

bash-3.2$ /Applications/XAMPP/xamppfiles/bin/pecl

Notice: unserialize(): Error at offset 250 of 1301 bytes in Config.php on line 1050
ERROR: The default config file is not a valid config file or is corrupted.

Luckily, the solution to this problem is pretty simple. First, delete pear.conf by making a backup in your XAMPP setup:

bash-3.2$ mv pear.conf pear.conf.backup

This way PECL will create a new and correct config file when running the command again. Obviously, XAMPP ships with a corrupt pear.conf.

Then, install the OAuth extension as usual:

bash-3.2$ sudo /Applications/XAMPP/xamppfiles/bin/pecl install oauth
...
downloading oauth-1.2.3.tgz ...
Starting to download oauth-1.2.3.tgz (45,531 bytes)
.............done: 45,531 bytes
6 source files, building
running: phpize
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
building in /private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3
running: /private/tmp/pear/temp/oauth/configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i386-apple-darwin12.4.0
checking host system type... i386-apple-darwin12.4.0
checking target system type... i386-apple-darwin12.4.0
checking for PHP prefix... /Applications/XAMPP/xamppfiles
checking for PHP includes... -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib
checking for PHP extension directory... /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525
checking for PHP installed headers prefix... /Applications/XAMPP/xamppfiles/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for oauth support... yes, shared
checking for cURL in default path... found in /usr
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin12.4.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/libtool --mode=compile cc  -I. -I/private/tmp/pear/temp/oauth -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/include -I/private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/main -I/private/tmp/pear/temp/oauth -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -Wall -g   -c /private/tmp/pear/temp/oauth/oauth.c -o oauth.lo
mkdir .libs
cc -I. -I/private/tmp/pear/temp/oauth -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/include -I/private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/main -I/private/tmp/pear/temp/oauth -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -g -c /private/tmp/pear/temp/oauth/oauth.c  -fno-common -DPIC -o .libs/oauth.o
/private/tmp/pear/temp/oauth/oauth.c:507:19: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types]
Z_STRVAL(first) = f->arKey;
^ ~~~~~~~~
/private/tmp/pear/temp/oauth/oauth.c:516:20: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types]
Z_STRVAL(second) = s->arKey;
^ ~~~~~~~~
2 warnings generated.
/bin/sh /private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/libtool --mode=compile cc  -I. -I/private/tmp/pear/temp/oauth -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/include -I/private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/main -I/private/tmp/pear/temp/oauth -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -Wall -g   -c /private/tmp/pear/temp/oauth/provider.c -o provider.lo
cc -I. -I/private/tmp/pear/temp/oauth -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/include -I/private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/main -I/private/tmp/pear/temp/oauth -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -g -c /private/tmp/pear/temp/oauth/provider.c  -fno-common -DPIC -o .libs/provider.o
/bin/sh /private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/libtool --mode=link cc -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/include -I/private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/main -I/private/tmp/pear/temp/oauth -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -Wall -g   -o oauth.la -export-dynamic -avoid-version -prefer-pic -module -rpath /private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/modules  oauth.lo provider.lo -lcurl
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/oauth.so -bundle  .libs/oauth.o .libs/provider.o  -lcurl
dsymutil .libs/oauth.so || :
creating oauth.la
(cd .libs && rm -f oauth.la && ln -s ../oauth.la oauth.la)
/bin/sh /private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/libtool --mode=install cp ./oauth.la /private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/modules
cp ./.libs/oauth.so /private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/modules/oauth.so
cp ./.libs/oauth.lai /private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/modules/oauth.la
----------------------------------------------------------------------
Libraries have been installed in:
/private/tmp/pear/temp/pear-build-rootjw6ahH/oauth-1.2.3/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
during execution
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
running: make INSTALL_ROOT="/private/tmp/pear/temp/pear-build-rootjw6ahH/install-oauth-1.2.3" install
Installing shared extensions:     /private/tmp/pear/temp/pear-build-rootjw6ahH/install-oauth-1.2.3/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525/
running: find "/private/tmp/pear/temp/pear-build-rootjw6ahH/install-oauth-1.2.3" | xargs ls -dils
5144976   0 drwxr-xr-x  3 root  wheel     102 30 Sep 17:09 /private/tmp/pear/temp/pear-build-rootjw6ahH/install-oauth-1.2.3
5145326   0 drwxr-xr-x  3 root  wheel     102 30 Sep 17:09 /private/tmp/pear/temp/pear-build-rootjw6ahH/install-oauth-1.2.3/Applications
5145327   0 drwxr-xr-x  3 root  wheel     102 30 Sep 17:09 /private/tmp/pear/temp/pear-build-rootjw6ahH/install-oauth-1.2.3/Applications/XAMPP
5145328   0 drwxr-xr-x  3 root  wheel     102 30 Sep 17:09 /private/tmp/pear/temp/pear-build-rootjw6ahH/install-oauth-1.2.3/Applications/XAMPP/xamppfiles
5145329   0 drwxr-xr-x  3 root  wheel     102 30 Sep 17:09 /private/tmp/pear/temp/pear-build-rootjw6ahH/install-oauth-1.2.3/Applications/XAMPP/xamppfiles/lib
5145330   0 drwxr-xr-x  3 root  wheel     102 30 Sep 17:09 /private/tmp/pear/temp/pear-build-rootjw6ahH/install-oauth-1.2.3/Applications/XAMPP/xamppfiles/lib/php
5145331   0 drwxr-xr-x  3 root  wheel     102 30 Sep 17:09 /private/tmp/pear/temp/pear-build-rootjw6ahH/install-oauth-1.2.3/Applications/XAMPP/xamppfiles/lib/php/extensions
5145332   0 drwxr-xr-x  3 root  wheel     102 30 Sep 17:09 /private/tmp/pear/temp/pear-build-rootjw6ahH/install-oauth-1.2.3/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525
5145333 200 -rwxr-xr-x  1 root  wheel  101592 30 Sep 17:09 /private/tmp/pear/temp/pear-build-rootjw6ahH/install-oauth-1.2.3/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525/oauth.so
Build process completed successfully
Installing '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525/oauth.so'
install ok: channel://pecl.php.net/oauth-1.2.3
Extension oauth enabled in php.ini

That’s it.