Ubuntu – pecl install zip giving error ubuntu 12.04

12.04PHP

I am trying to install zip using this command

pecl install zip

but I am getting below error

running: make
/bin/bash /tmp/pear/temp/pear-build-root9LqSPb/zip-1.12.4/libtool --mode=compile cc  -I. -I/tmp/pear/temp/zip -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root9LqSPb/zip-1.12.4/include -I/tmp/pear/temp/pear-build-root9LqSPb/zip-1.12.4/main -I/tmp/pear/temp/zip -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/tmp/pear/temp/zip/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/zip/php_zip.c -o php_zip.lo
libtool: compile:  cc -I. -I/tmp/pear/temp/zip -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root9LqSPb/zip-1.12.4/include -I/tmp/pear/temp/pear-build-root9LqSPb/zip-1.12.4/main -I/tmp/pear/temp/zip -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/tmp/pear/temp/zip/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/zip/php_zip.c  -fPIC -DPIC -o .libs/php_zip.o
In file included from /tmp/pear/temp/zip/php_zip.c:30:0:
/usr/include/php5/ext/pcre/php_pcre.h:29:18: fatal error: pcre.h: No such file or directory
compilation terminated.
make: *** [php_zip.lo] Error 1
ERROR: `make' failed

Any idea what is wrong?
Thanks

Best Answer

Perl compatible regular expressions - PCRE libraries is missing (...fatal error: pcre.h:...), because you are compiling module you should add dev packages too:

sudo apt-get update  
sudo apt-get install libpcre3 libpcre3-dev