Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I installed PHP 5.3.8 from source on Ubuntu Natty. I also enabled FPM during configuration.

However, I've been having issues installing PHP extensions. When I add the extension to my php.ini file (e.g. extension=apc.so) and restart PHP (i.e. /etc/init.d/php-fpm restart), I get an error like the one below:

Starting php-fpm PHP Warning:  Module 'apc' already loaded in Unknown on line 0
<br />
<b>Warning</b>:  Module 'apc' already loaded in <b>Unknown</b> on line <b>0</b><br />
PHP Warning:  Module 'geoip' already loaded in Unknown on line 0
<br />
<b>Warning</b>:  Module 'geoip' already loaded in <b>Unknown</b> on line <b>0</b><br />
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
<br />
<b>Warning</b>:  Module 'imagick' already loaded in <b>Unknown</b> on line <b>0</b><br />
PHP Warning:  Module 'memcache' already loaded in Unknown on line 0
<br />

My PHP-FPM conf is has the setting pm.start_servers = 5, so I have about 5 PHP-FPM workers active. Are they all trying to load the php.ini file when I restart PHP (hence the message that the module has already been loaded)?! If they are, is there a way I can prevent that to stop the errors as it the errors become fatal when I load Zend Loader?

Thanks in advance.

share|improve this question
    
possible duplicate of Configuration Issues with PECL and PHP-FPM –  quanta Nov 18 '11 at 3:11

2 Answers 2

up vote 2 down vote accepted

I solved this earlier on StackOverflow. Here's the link to the information.

Does each PHP-FPM Worker individually load php.ini?

Cheers.

share|improve this answer

The following command shows you which .ini-files are used:

ubuntu@server:~$ php --ini
Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File:         /usr/local/etc/php-cli.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed:      /usr/local/etc/php/apc.ini,
/usr/local/etc/php/memcache.ini,
/usr/local/etc/php/xhprof.ini

This should help you trouble-shooting.

Most of the time you want to not edit php.ini directly, but instead override/extend the configuration by placing additional .ini-files in a directory (/usr/local/etc/php in my example).

If this is not set/available, you need to adjust your ./configure command to include --with-config-file-scan-dir.

Btw, dotdeb might be a better option for you.

share|improve this answer
    
Hi Till, sorry for the late response. I was able to solve this issue earlier. I've posted a link to my answer. Cheers. –  Obi Hill Dec 28 '11 at 15:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.