# php5-extensions php5-zip borked?



## nickviche (Oct 12, 2011)

I am trying to install php5-zip in php5-extensions port, I will get this error message. I tried on a different host so I was sure this was not related to a jail issue. 
Port fails to build/install if Zip library is selected. Below is the error message and the config for the port. 
Thank you in advance for any replies. 




```
mmocafe# make showconfig
===> The following configuration options are available for php5-extensions-1.5:
     BCMATH=off "bc style precision math functions"
     BZ2=off "bzip2 library support"
     CALENDAR=off "calendar conversion support"
     CTYPE=on "ctype functions"
     CURL=on "CURL support"
     DBA=off "dba support"
     DOM=on "DOM support"
     EXIF=off "EXIF support"
     FILEINFO=off "fileinfo support"
     FILTER=off "input filter support"
     FRIBIDI=off "FriBidi support"
     FTP=off "FTP support"
     GD=on "GD library support"
     GETTEXT=on "gettext library support"
     GMP=off "GNU MP support"
     HASH=on "HASH Message Digest Framework"
     ICONV=on "iconv support"
     IMAP=off "IMAP support"
     INTERBASE=off "Interbase 6 database support (Firebird)"
     JSON=on "JavaScript Object Serialization support"
     LDAP=off "OpenLDAP support"
     MBSTRING=off "multibyte string support"
     MCRYPT=on "Encryption support"
     MSSQL=off "MS-SQL database support"
     MYSQL=on "MySQL database support"
     MYSQLI=on "MySQLi database support"
     ODBC=off "ODBC support"
     OPENSSL=on "OpenSSL support"
     PCNTL=off "pcntl support (CLI only)"
     PDF=off "PDFlib support (implies GD)"
     PDO=on "PHP Data Objects Interface (PDO)"
     PDO_SQLITE=on "PDO sqlite driver"
     PGSQL=off "PostgreSQL database support"
     POSIX=on "POSIX-like functions"
     PSPELL=off "pspell support"
     READLINE=off "readline support (CLI only)"
     RECODE=off "recode support"
     SESSION=on "session support"
     SHMOP=off "shmop support"
     SIMPLEXML=on "simplexml support"
     SNMP=off "SNMP support"
     SOAP=off "SOAP support"
     SOCKETS=off "sockets support"
     SQLITE=on "sqlite support"
     SQLITE3=on "sqlite3 support"
     SYBASE_CT=off "Sybase database support"
     SYSVMSG=off "System V message support"
     SYSVSEM=off "System V semaphore support"
     SYSVSHM=off "System V shared memory support"
     TIDY=off "TIDY support"
     TOKENIZER=on "tokenizer support"
     WDDX=off "WDDX support (implies XML)"
     XML=on "XML support"
     XMLREADER=on "XMLReader support"
     XMLRPC=off "XMLRPC-EPI support"
     XMLWRITER=on "XMLWriter support"
     XSL=off "XSL support (Implies DOM)"
     YAZ=off "YAZ support (ANSI/NISO Z39.50)"
     ZIP=on "ZIP support"
     ZLIB=on "ZLIB support"
===> Use 'make config' to modify these settings
```

The error message. 


```
/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/php_zip.c:664: error: 'pcre_extra' undeclar ed (first use in
 this function)
*** Error code 1
1 error
*** Error code 1

Stop in /basejail/usr/ports/archivers/php5-zip.
*** Error code 1

Stop in /basejail/usr/ports/lang/php5-extensions.
*** Error code 1

Stop in /basejail/usr/ports/lang/php5-extensions.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20111012-49227-50gexe-0 env UPGRADE_TOOL=portupgrade
 UPGRADE_PORT=php5-extensions-1.5 UPGRADE_PORT_VER=1.5 make
** Fix the problem and try again.
--->  Build of lang/php5-extensions ended at: Wed, 12 Oct 2011 19:33:34 +0000 (consumed 00:00:08)
--->  Reinstallation of lang/php5-extensions ended at: Wed, 12 Oct 2011 19:33:34 +0000 (consumed 00:00:08)
--->  ** Upgrade tasks 1: 0 done, 0 ignored, 0 skipped and 1 failed
--->  Listing the results (+:done / -:ignored / *:skipped / !:failed)
        ! lang/php5-extensions (php5-extensions-1.5)    (missing header)
--->  Packages processed: 0 done, 0 ignored, 0 skipped and 1 failed
--->  Session ended at: Wed, 12 Oct 2011 19:33:34 +0000 (consumed 00:03:03)
```


----------



## nickviche (Oct 12, 2011)

Here is the full error. 

```
===>    Verifying reinstall for /usr/local/lib/php/20090626-zts/zip.so in /usr/ports/archivers/php5-zip
===>  Building for php5-zip-5.3.8
/bin/sh /var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/libtool --mode=compile cc  -I. -
I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip -DPHP_ATOM_INC -I/var/ports/basejail/usr/ports/archivers/php5-
zip/work/php-5.3.8/ext/zip/include -I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/main -
I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip -I/usr/local/include/php -I/usr/local/include/php/main -
I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  
-O2 -pipe -fno-strict-aliasing   -c /var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/php_zip.c -o php_zip.lo
/bin/sh /var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/libtool --mode=compile cc  -I. -
I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip -DPHP_ATOM_INC -I/var/ports/basejail/usr/ports/archivers/php5-
zip/work/php-5.3.8/ext/zip/include -I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/main -
I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip -I/usr/local/include/php -I/usr/local/include/php/main -
I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  
-O2 -pipe -fno-strict-aliasing   -c /var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/lib/zip_source_filep.c -o 
lib/zip_source_filep.lo
 cc -I. -I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip -DPHP_ATOM_INC -
I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/include -I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-
5.3.8/ext/zip/main -I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip -I/usr/local/include/php -
I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -
I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe -fno-strict-aliasing -c /var/ports/basejail/usr/ports/archivers/php5-
zip/work/php-5.3.8/ext/zip/lib/zip_source_filep.c  -fPIC -DPIC -o lib/.libs/zip_source_filep.o
 cc -I. -I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip -DPHP_ATOM_INC -
I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/include -I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-
5.3.8/ext/zip/main -I/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip -I/usr/local/include/php -
I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -
I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe -fno-strict-aliasing -c /var/ports/basejail/usr/ports/archivers/php5-
zip/work/php-5.3.8/ext/zip/php_zip.c  -fPIC -DPIC -o .libs/php_zip.o
In file included from /var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/php_zip.c:30:
/usr/local/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
In file included from /var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/php_zip.c:30:
/usr/local/include/php/ext/pcre/php_pcre.h:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before 'pcre'
/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/php_zip.c: In function 'php_zip_pcre':
/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/php_zip.c:663: error: 'pcre' undeclared (first use in this function)
/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/php_zip.c:663: error: (Each undeclared identifier is reported only once
/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/php_zip.c:663: error: for each function it appears in.)
/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/php_zip.c:663: error: 're' undeclared (first use in this function)
/var/ports/basejail/usr/ports/archivers/php5-zip/work/php-5.3.8/ext/zip/php_zip.c:664: error: 'pcre_extra' undeclared (first use in this function)
*** Error code 1
1 error
*** Error code 1

Stop in /basejail/usr/ports/archivers/php5-zip.
*** Error code 1

Stop in /basejail/usr/ports/archivers/php5-zip.
*** Error code 1

Stop in /basejail/usr/ports/lang/php5-extensions.
*** Error code 1

Stop in /basejail/usr/ports/lang/php5-extensions.
*** Error code 1

Stop in /basejail/usr/ports/lang/php5-extensions.
```


----------



## Carpetsmoker (Oct 12, 2011)

> I am trying to install php5-zip in php5-extensions port, I will get this error message. I tried on a different host so I was sure this was not related to a jail issue.



So, if I understand this correctly, you have the same problem on two machines?

I just built & installed the archivers/php5-zip port without problems.

In any case, the first error line is:

```
/usr/local/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
```

This file should be in /usr/local/include/pcre.h, just in case, please verify this file exists and is readable.

I suspect that your problem is that your cc command/CFLAGS there is no -I/usr/local/include  -- This should be added by the port. I'm not sure why it's missing...

As a quick workaround, you can use:
*make CFLAGS=-I/usr/local/include*

This should probably fix this particular error ... But it doesn't solve the underlying issue though ...


----------



## SirDice (Oct 13, 2011)

I'm guessing you haven't updated in a while and inadvertently updated from 5.2 to 5.3. This is probably the issue:

```
20100409:
  AFFECTS: users of lang/php5
  AUTHOR: ale@FreeBSD.org
  
  As of PHP 5.3, a few extensions were removed from or included into the core
  PHP5 package.  Follow the steps below to update your installation.

  1) Delete the following packages (if installed):
  
     - php5-dbase
     - php5-ncurses
     - php5-pcre
     - php5-spl
     - php5-ming
     - php5-mhash
  
  2) Rebuild lang/php5 and all ports that depend on it.
```
Taken from /usr/ports/UPDATING


----------



## nickviche (Oct 13, 2011)

@Carpetsmoker thx that worked. 

@SirDice nope this is a fresh install and if you notice php5-extenstions which is 5.3.8 and not php52-extensions which will no longer be supported as per notice from PHP.org.


----------



## SirDice (Oct 13, 2011)

nickviche said:
			
		

> @SirDice nope this is a fresh install and if you notice php5-extenstions which is 5.3.8 and not php52-extensions which will no longer be supported as per notice from PHP.org.


Yes, but not too long ago php5 was renamed to php52 and php5 became 5.3. So it's quite possible to have upgraded from 5.2 to 5.3 without the names of the installed ports changing.

But if this is a fresh install this would indeed not be the case.


----------



## fms (Oct 17, 2011)

Hi,



			
				nickviche said:
			
		

> @Carpetsmoker thx that worked.



I've met the same situation, and in my case,ã€€existence of /usr/local/include/php/ext/pcre/config.h
and the line 
	
	



```
#define COMPILE_DL_PCRE 1
```
 in it has caused it. Your problem seems to be solved, but could you show us the content of /usr/local/include/php/ext/php_config.h and /usr/local/include/php/ext/pcre/config.h to know if it is the case?

Thanks in advance,


----------

