How to run PHP examples for ICE on FreeBSD host

ICE port for FreeBSD as of version 3.5.1 by default builds and installs only C++ bindings.
To install PHP bindings you need to perform some extra work.

They might fix this in further releases, so please check it.
Likely it's already fixed and you won't need to perform steps described here.

1. Build and install ICE package:

# cd /usr/ports/devel/ice
# make install

2. Download patch Make.rules.php.patch, apply it and build PHP library:

# cd /usr/ports/devel/ice/work/Ice-*/php
# patch < Make.rules.php.patch
# gmake PHP_HOME=/usr/local

3. Install PHP library:

# cp lib/IcePHP.so /usr/local/lib/php/20100525
# echo IcePHP.so >> /usr/local/etc/php/extensions.ini