# php: extensions.ini



## cbrace (Jan 24, 2015)

Hi all,

Each time I update ports/php5, it appears that php/extensions.ini is updated with -- no surprise -- the list of extensions.

Each time this happens, however, many of the entry lines get duplicated (it would seem the update processes appends the list of entries to the existing file rather than rewriting it). This may not be a fatal error, but one of my cron jobs runs a php script every 15 minutes and I then get spammed by error messages, ie:

```
PHP Warning: Module 'bz2' already loaded in Unknown on line 0
```
I can fix this by piping the ini file through sort and uniq to remove the duplicate lines, but this a nuisance to do every time the php5 port is updated. Can someone suggest a more permanent fix?

Thanks


----------



## talsamon (Jan 24, 2015)

Comment out the module in /usr/local/etc/php/extensions.ini (with a ; ).


----------



## cbrace (Jan 24, 2015)

Thanks, but you don't seem to understand problem. Commenting out stuff won't fix this.

Currently, the .ini file is correct and php runs fine (no errors in the cronjob).

However, next time I update the port, the process will, I assume, again append the list of extensions to the existing  file and the problem will return.


----------



## talsamon (Jan 24, 2015)

Where is the problem? Save the extensions.ini and copy it back, if it's overwritten.


----------



## cbrace (Jan 24, 2015)

Sure, I can do that. Just wondering if there is a more elegant solution, that's all.


----------



## talsamon (Jan 24, 2015)

I don't know if there's another solution. But extensions.ini has a strange behaviour. Sometimes I had also the "problem". Another time nothing changed after update. And sometimes I had to add a module. Seems it depends on the modules which are installed.


----------



## gkontos (Jan 24, 2015)

I always copy extensions.ini to extensions.ini.bak and revert it after the upgrade. The reason is that when you upgrade, the extensions are appended to that file.


----------

