# Reinstalling php52-extensions goes wrong



## kenorb (Nov 10, 2010)

I reinstalled my /usr/ports/lang/php52-extensions port by:

```
cd /usr/ports/lang/php52-extensions && sudo make FORCE_PKG_REGISTER=1 install
```

Now I've got following warnings:

```
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/memcache.so' - Cannot open "/usr/local/lib/php/20060613/memcache.so" in Unknown on line 0
PHP Warning:  Module 'ctype' already loaded in Unknown on line 0
PHP Warning:  Module 'curl' already loaded in Unknown on line 0
PHP Warning:  Module 'pcre' already loaded in Unknown on line 0
PHP Warning:  Module 'SimpleXML' already loaded in Unknown on line 0
PHP Warning:  Module 'SPL' already loaded in Unknown on line 0
PHP Warning:  Module 'dom' already loaded in Unknown on line 0
PHP Warning:  Module 'filter' already loaded in Unknown on line 0
PHP Warning:  Module 'gd' already loaded in Unknown on line 0
PHP Warning:  Module 'hash' already loaded in Unknown on line 0
PHP Warning:  Module 'iconv' already loaded in Unknown on line 0
PHP Warning:  Module 'json' already loaded in Unknown on line 0
PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
PHP Warning:  Module 'pdo_sqlite' already loaded in Unknown on line 0
PHP Warning:  Module 'pdo_mysql' already loaded in Unknown on line 0
PHP Warning:  Module 'posix' already loaded in Unknown on line 0
PHP Warning:  Module 'session' already loaded in Unknown on line 0
PHP Warning:  Module 'pspell' already loaded in Unknown on line 0
PHP Warning:  Module 'SQLite' already loaded in Unknown on line 0
PHP Warning:  Module 'tokenizer' already loaded in Unknown on line 0
PHP Warning:  Module 'xml' already loaded in Unknown on line 0
PHP Warning:  Module 'xmlreader' already loaded in Unknown on line 0
PHP Warning:  Module 'xmlwriter' already loaded in Unknown on line 0
PHP Warning:  Module 'zip' already loaded in Unknown on line 0
PHP Warning:  Module 'zlib' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/xcache.so' - Cannot open "/usr/local/lib/php/20060613/xcache.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/xdebug.so' - Cannot open "/usr/local/lib/php/20060613/xdebug.so" in Unknown on line 0
```

Looks like extensions after reinstall are added second time:

```
> cat /usr/local/etc/php/extensions.ini 
extension=ctype.so
extension=curl.so
extension=pcre.so
extension=simplexml.so
extension=spl.so
extension=dom.so
extension=filter.so
extension=session.so
extension=pspell.so
extension=gd.so
extension=hash.so
extension=iconv.so
extension=json.so
extension=mysql.so
extension=pdo.so
extension=pdo_sqlite.so
extension=pdo_mysql.so
extension=posix.so
extension=sqlite.so
extension=tokenizer.so
extension=xml.so
extension=xmlreader.so
extension=xmlwriter.so
extension=zip.so
extension=zlib.so
extension=memcache.so
extension=ctype.so
extension=curl.so
extension=pcre.so
extension=simplexml.so
extension=spl.so
extension=dom.so
extension=filter.so
extension=gd.so
extension=hash.so
extension=iconv.so
extension=json.so
extension=mysql.so
extension=pdo.so
extension=pdo_sqlite.so
extension=pdo_mysql.so
extension=posix.so
extension=session.so
extension=pspell.so
extension=sqlite.so
extension=tokenizer.so
extension=xml.so
extension=xmlreader.so
extension=xmlwriter.so
extension=zip.so
extension=zlib.so
```

I'm not looking for workaround (I know that I can remove them manually). But when I do this again, or somebody will do that, it will happen again.
I'm looking for proper fix in ports, or whatever the bug came from.
Should I raise PR for that purpose?


----------



## chrcol (Nov 12, 2010)

usually I use 
	
	



```
portupgrade -if <port name>
```
 to reinstall.

or 
	
	



```
make deinstall reinstall clean
```

I think your command was possibly the cause, or it could be a broken port.


----------

