Home  >  Article  >  Backend Development  >  What should I do if php -m does not find the extension?

What should I do if php -m does not find the extension?

藏色散人
藏色散人Original
2021-02-23 18:01:432458browse

php -m did not find the extension because the configuration files of php-fpm mode and cli mode are inconsistent. The solution: first check the php installation location through which php command; then copy the php.ini file to the bin directory Just download it.

What should I do if php -m does not find the extension?

The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.

php -m command cannot see the newly installed php extension, but there is ?

in phpinfo(). This situation is generally because the configuration files of php-fpm mode and cli mode are inconsistent. Use the command php -i | grep Loaded\ Configuration\ File It can be seen that the configuration file php.ini is not found in cli mode:

Solution:

Check the php installation location through the which php command:

[Recommended: PHP Video tutorial

Use the strace command to print the log:

strace /usr/local/bin/php -i 2>/phplog.log

Search the keyword php.ini in the log file and find the cli mode in this directory. php.ini file, but there is no php.ini in this directory:

What needs to be done is to copy the php.ini file to the next copy of this directory:

cp /etc/php.ini /usr/local/bin/php.ini

The above is the detailed content of What should I do if php -m does not find the extension?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn