Question

I'm installing APCu on my vagrant box, but found that pecl didn't have my ini files set on it, so I've added it manually & PHP in apache is now wokring fine, however my CLI uses a different php.ini file. Is there an easy way to get installs to update both files at the same time?

Was it helpful?

Solution

No, there is no out-of-the-box solution. pecl (which is pear -c pecl.php.net) only can update a single php.ini file.

What you could do is create one ini file and symlink it into the conf directories of each php version. (See "Scan for additional .ini files in" in php --ini).

OTHER TIPS

I've recently learnt that you could use the following strategy:

echo "" > /etc/php5/mods-available/timezonedb.ini
pear config-set php_ini /etc/php5/mods-available/timezonedb.ini

pecl -q install -f timezonedb && php5enmod timezonedb

The php5enmod command will automatically link the configuration file to every SAPI (cli, fpm, ...).

php5enmod

usage: php5enmod [ -s ALL|sapi_name ] module_name [ module_name_2 ]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top