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

藏色散人
Release: 2023-03-08 08:30:02
Original
2448 people have browsed it

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
Copy after login

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
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template