After a couple of hours, I managed to find a way to fix this. I suggest that this would be more useful for compiling and installing PHP with FPM from the source (all that you apt-get probably have nothing to do with this)
This is mainly due to using your php-fpm.conf to load all of your PHP extensions instead of php.ini. Here is what you do:
Open the php-fpm.conf file (I installed my php from the source, so I have mine on /usr/local/php/etc/php-fpm.conf based on how I install my --prefix and --with-config-file-path , but you can use find / -name "php-fpm.conf" from the bash shell to find where yours is).
Add your extension download directives (ideally at the end of the file). You have to be careful, as the format is a bit different. In your php.ini file it will look like extension=apc.so , but in your php-fpm.conf file it should be defined as follows: php_admin_value[extension]=apc.so
NOTE. Make sure your extension_dir file (where you saved all the .so files for your extensions) is defined in the php.ini file. Then restart php-fpm.
I have done this above and have no more errors, and all my extensions are displayed in phpinfo() .
Hope this helps someone, it almost drove me crazy.
Greetings.
EDIT
After further testing, I found that the problem was actually a bit more complicated. This is because PHP loads php.ini twice, because at compile time I specified the same place for --with-config-file-path and --with-config-file-scan-dir .
So, you would like to do the following as the best alternative to what I indicated above (which also works, but has a limitation, since you will not be able to download Zend extensions, for example IonCube Loader):
- Compile PHP with the following option
--with-config-file-scan-dir=/usr/local/php/etc/conf.d Make this another directory from --with-config-file-path . - Create a separate file to load the PHP extensions (you can call it phpext.ini) and save it in the location defined above ie
/usr/local/php/etc/conf.d . In this file, define all the extensions you want to download, for example. extension=apc.so Your extensions should be stored in the /usr/lib/php5/20090626/ , which I assume should be the default directory. Make sure you do not define your extensions in the main php.ini file. - PHP reload
Now everything will work well, and you can download the Zend extensions (as they should be defined in your php.ini file and cannot be in php-fpm.conf).
Greetings.
source share