Home > PHP Framework > Swoole > body text

Swoole FAQ: Introduction to 'It is present in phpinfo but not in php -m'

藏色散人
Release: 2019-12-14 11:09:00
forward
2050 people have browsed it

Swoole FAQ: Introduction to 'It is present in phpinfo but not in php -m'

Yes in phpinfo but not in php -m

First confirm whether it is in CLI mode

Command line input php --ri swoole

If the extended information of swoole is output, it means that your installation is successful!

99.999% of people are at this step If successful, you can use swoole directly

You don’t need to worry about whether php -m or phpinfo web page prints out whether there is swoole

Because swoole runs in cli mode and functions in traditional fpm mode Very limited

Any asynchronous/coroutine and other major functions cannot be used in fpm mode. 99.999% of people cannot get what they want in fpm mode, but they are confused about why there is no extended information in fpm mode

First make sure you truly understand the operating mode of swoole before continuing to investigate the installation information issue!

Cause

After compiling and installing swoole, It is available in the phpinfo page of php-fpm/apache, but not in the php -m on the command line. The reason may be that cli/php-fpm/apache uses different php.ini configuration

Solution

1. Confirm the location of php.ini

cli command line

php -i|grep php.ini
Copy after login

or

php --ini
php-fpm/apache,查看phpinfo页面找到php.ini的绝对路径。
Copy after login

2. Check whether the corresponding php.ini has extension=swoole.so

cat /path/to/php.ini | grep swoole.so
Copy after login

Why can I see the web page from the command line? If you don’t read the above carefully in

, it shows that the ini configuration files in cli and apache/fpm modes are in different locations, and you need to find the correct ini file.

Recommended study: swoole tutorial

The above is the detailed content of Swoole FAQ: Introduction to 'It is present in phpinfo but not in php -m'. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:swoole.com
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