Home  >  Article  >  PHP Framework  >  Swoole FAQ: Introduction to 'It is present in phpinfo but not in php -m'

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

藏色散人
藏色散人forward
2019-12-14 11:09:002042browse

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

or

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

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

cat /path/to/php.ini | grep swoole.so

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!

Statement:
This article is reproduced at:swoole.com. If there is any infringement, please contact admin@php.cn delete