Ubuntu – pecl install phar – failed [SOLVED]

If you get this error on Ubuntu when trying to install phar for php:

In file included from /usr/include/php5/ext/spl/spl_iterators.h:27,
                 from /usr/include/php5/ext/spl/spl_array.h:26,
                 from /tmp/pear/temp/phar/phar_internal.h:59,
                 from /tmp/pear/temp/phar/util.c:23:
/usr/include/php5/ext/pcre/php_pcre.h:45: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/include/php5/ext/pcre/php_pcre.h:46: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/include/php5/ext/pcre/php_pcre.h:52: error: expected specifier-qualifier-list
before ‘pcre’
make: *** [util.lo] Error 1
ERROR: `make' failed

To fix this just install libpcre3-dev

sudo apt-get install libpcre3-dev

Then continue with the pecl install:

sudo pecl install phar

Leave a Reply

Your email address will not be published. Required fields are marked *