# I messed up PHP



## millionaire_mind (May 25, 2010)

I messed up my PHP configuration yesterday.

Today, when I run "portupgrade -r php5\*", I get:


```
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! mail/php5-imap (php5-imap-5.2.9)      (missing header)
        ! databases/phpmyadmin (phpMyAdmin-3.1.3.1)     (install error)
        * www/horde-base (horde-base-3.3.3)
        * mail/horde-turba (horde-turba-2.3.1_1)
        * mail/horde-imp (horde-imp-4.3.3,1)
xxx-xxx-xxx-xxx#
```

imap is what I'm trying to get to work.  Any help is greatly appreciated.


----------



## SirDice (May 25, 2010)

A similar issue recently popped up here.

The answer is in /usr/ports/UPDATING:


> 20100409:
> AFFECTS: users of lang/php5
> AUTHOR: ale@FreeBSD.org
> 
> ...


----------



## millionaire_mind (May 25, 2010)

1)  None of the listed packages show up when I do pkg_info
2)  I tried to rebuild PHP5 by issuing "portupgrade -r php5\*"

What am I missing?


----------



## SirDice (May 25, 2010)

Try installing/updating php5-imap first, instead of doing everything in one go. Have a look at why it's failing.


----------



## millionaire_mind (May 25, 2010)

Thank you for helping me on this SirDice, I have quite a few people who are not very happy with me right now because their email has been shut down for 24 hours.


```
xxx-xxx-xxx-xxx# make install clean
===>  Building for php5-imap-5.3.2
/bin/sh /usr/ports/mail/php5-imap/work/php-5.3.2/ext/imap/libtool --mode=compile cc  -I. -I/usr/ports/mail/php5-imap/work/php-5.3.2/ext/imap 
-DPHP_ATOM_INC -I/usr/ports/mail/php5-imap/work/php-5.3.2/ext/imap/include -I/usr/ports/mail/php5-imap/work/php-5.3.2/ext/imap/main -I/usr
/ports/mail/php5-imap/work/php-5.3.2/ext/imap -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 -I/usr/local/include/c-client  -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 -fno-strict-aliasing -pipe   -c /usr/ports/mail/php5-imap/work/php-5.3.2/ext/imap
/php_imap.c -o php_imap.lo
 cc -I. -I/usr/ports/mail/php5-imap/work/php-5.3.2/ext/imap -DPHP_ATOM_INC -I/usr/ports/mail/php5-imap/work/php-5.3.2/ext/imap/include -I/usr
/ports/mail/php5-imap/work/php-5.3.2/ext/imap/main -I/usr/ports/mail/php5-imap/work/php-5.3.2/ext/imap -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 -I/usr/local/include/c-client -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 -fno-strict-aliasing -pipe -c 
/usr/ports/mail/php5-imap/work/php-5.3.2/ext/imap/php_imap.c  -fPIC -DPIC -o .libs/php_imap.o
In file included from /usr/ports/mail/php5-imap/work/php-5.3.2/ext/imap/php_imap.c:44:
/usr/local/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
In file included from /usr/ports/mail/php5-imap/work/php-5.3.2/ext/imap/php_imap.c:44:
/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'
*** Error code 1
1 error
*** Error code 1

Stop in /usr/ports/mail/php5-imap.
xxx-xxx-xxx-xxx#
```


----------



## millionaire_mind (May 25, 2010)

I found the solution:


```
cd /usr/ports/lang/php5/
make extract
cp /usr/ports/lang/php5/work/php-5.3.2/ext/pcre/pcrelib/pcre.h /usr/local/include/php/ext/pcre/
```


----------



## gilinko (May 25, 2010)

millionaire_mind said:
			
		

> I found the solution:
> 
> 
> ```
> ...



Remember that it is only a temporary solution. You really should reinstall php with the proper pcre support. Some times it does take a "reconfiguration" of the port to clean out any stale options, ie
`# make rmconfig config install clean`

(the config is not really necessary after a rmconfig, but for clarity sake...)


----------

