Home  >  Article  >  Backend Development  >  linux - There is already a mysqli extension in phpinfo, but it still cannot be used and reports mysqli not found. How to solve it?

linux - There is already a mysqli extension in phpinfo, but it still cannot be used and reports mysqli not found. How to solve it?

WBOY
WBOYOriginal
2016-09-06 08:57:121316browse

phpinfo has displayed the relevant expansion information of mysqli
linux - There is already a mysqli extension in phpinfo, but it still cannot be used and reports mysqli not found. How to solve it?
But when executing php xxx.php from the command line, it still reports mysqli not found
linux - There is already a mysqli extension in phpinfo, but it still cannot be used and reports mysqli not found. How to solve it?

video_order.php code:
linux - There is already a mysqli extension in phpinfo, but it still cannot be used and reports mysqli not found. How to solve it?

video_order.php is a script file, so I want to test it on the command line. How to solve it? Waiting online

Reply content:

phpinfo has displayed the relevant expansion information of mysqli
linux - There is already a mysqli extension in phpinfo, but it still cannot be used and reports mysqli not found. How to solve it?
But when executing php xxx.php from the command line, it still reports mysqli not found
linux - There is already a mysqli extension in phpinfo, but it still cannot be used and reports mysqli not found. How to solve it?

video_order.php code:
linux - There is already a mysqli extension in phpinfo, but it still cannot be used and reports mysqli not found. How to solve it?

video_order.php is a script file, so I want to test it on the command line. How to solve it? Waiting online

I also encountered it, and the solution at that time was to change to a php version

The permissions have been adjusted and the browser can also access it. However, when executing the file through the command line php, an error is reported. How to solve it! ! Waiting online, urgentlinux - There is already a mysqli extension in phpinfo, but it still cannot be used and reports mysqli not found. How to solve it?

Is the php.ini path on the command line configured? When using the command line, pass the -c parameter to the path to the php.ini file.
php -c /.../php.ini /.../video_order.php

You directly access the web version, which executes cgi's php, and the command line executes cli's php. Try specifying the php.ini path of cli. Maybe cgi’s php.ini and cli’s php.ini are separate

The configuration files used for web page and command line execution are not necessarily the same
You can execute php --ini on the command line to check the loaded configuration file or directly execute php -m to check whether the mysqli extension is enabled

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