Numerous sites on the internet have answered the basic question of “how do I install yaz for PHP on Ubuntu”. Which basically boils down to:
sudo apt-get install yaz sudo apt-get install pecl sudo pecl install yaz
Then add the following line to /etc/php5/apache2/php.ini:
Sadly, the pecl install will fail with the error:
checking for yaz-config... NONE configure: error: YAZ not found (missing NONE) ERROR: `/tmp/pear/temp/yaz/configure --with-yaz' failed
All the search results for this error solve it by downloading the yaz source code and compiling and installing it outside the package manager, which is non-ideal.
The missing piece is that yaz-config is included with the libyaz4-dev package:
sudo apt-get install libyaz4-dev
Interestingly, this yaz install blog post does explicitly calls out the need for the -dev packages, but doesn’t include the error when you don’t have it. Hopefully this blog post will tie the two bits together for future people perplexed by this.