Earlier, I wrote this blog on how to use PECL extensions within OpenSolaris. Now, there will be some scenario where in a simple pecl install <extension name> might not work because of how the script might have been written or what external dependencies like it depends etc.
For example, if you wanted to get mailparse PECL extension working within opensolaris, you would obviously try the following command first
|
pfexec /usr/php/bin/pecl install mailparse
|
and would probably be scratching your head when you run into the below error ...
|
bash-3.2# /usr/php/bin/pecl install mailparse downloading mailparse-2.1.4.tar ... Starting to download mailparse-2.1.4.tar (Unknown size) ........................................done: 188,416 bytes 9 source files, building running: phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 building in /var/tmp/pear-build-defaultuser/mailparse-2.1.4 ...
checking for re2c... no configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
|
What the above error means that while PECL framework trying to build the mailparse extension , it is looking for a tool known as 're2c' (which is internally used by PHP). Unfortunately, this tool has not yet made its ways into OpenSolaris yet. I am pretty sure, this tool will soon make its way into OpenSolaris repository as well..
Okay, in these scenario, here is another quickie to get things going for you...
- Within your OpenSolaris machine, manually download mailparse extension from PECL repository
- run /usr/php/bin/phpize , followed by configure and build command.
|
[sriramn@sriramn]'~'>gunzip -c mailparse-1.1.4.tar.gz | tar xvfp -
[sriramn@sriramn]'~'> cd mailparse-1.1.4
[sriramn@sriramn]'~'>/usr/php/bin/phpize
[sriramn@sriramn]'~'>./configure --with-php-config=/usr/php/bin/php-config && gmake && gmake install
|
Now, mailparse extension should be available under /var/php/5.2/modules directory. If you would like to include any mailparse specific extension, you will need to define them within /etc/php/5.2/php.ini
Af course, for Apache/PHP module to load these new extensions, you will need to restart Apache/PHP server by doing some thing like.. I am sure, you know this already
blogs.sun.com/images/smileys/smile.gif" class="smiley" alt=":-)" title=":-)" />
svcadm restart http:apache22