问题
I have compiled version 5.4.14 of PHP on a linux system using the same configuration I had for a 5.4.13 version. I run the following PHP -i command and I get:
[root@localhost php-5.4.14]# php -i
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/20100525/fileinfo.so' - /usr/lib64/20100525/fileinfo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/20100525/json.so' - /usr/lib64/20100525/json.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/20100525/phar.so' - /usr/lib64/20100525/phar.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/20100525/zip.so' - /usr/lib64/20100525/zip.so: cannot open shared object file: No such file or directory in Unknown on line 0
Now I know that JSON is now part of the PHP core and there is no JSON.SO (I assume the same for the others). Is anyone aware of why this is a problem? I do not have any extension=XXXX.so lines in my php.ini file. I am compiling under Centos 6.4.
回答1:
Got it -- A directory /etc/php.d was added. This contains a bunch of .ini files which are added to the processing of php.ini. The json.ini file, for example, simply says: extension=json.so
After spending too long looking for the answer, I happened to catch a line in the php -i output specifying the additional .ini directory. Hope this saves someone some time some day.
来源:https://stackoverflow.com/questions/16122348/php-extensions-not-found