Home > PHP Framework > Swoole > How to solve the problem that the swoole extension cannot be added

How to solve the problem that the swoole extension cannot be added

藏色散人
Release: 2022-01-20 10:48:38
Original
2800 people have browsed it

The solution to the problem that the swoole extension cannot be added: 1. Modify "./configure"; 2. Execute make first, then make install; 3. Modify "extension=swoole.so".

How to solve the problem that the swoole extension cannot be added

The operating environment of this article: Windows 10 system, Swoole 4 version, DELL G3 computer

Can’t the swoole extension be added?

Record the problems encountered when installing swoole

The front is the same as the official website:

Before installing swoole, you must ensure that the following software has been installed on the system

php-5.3.10 或更高版本
gcc-4.4 或更高版本
make
autoconf
Copy after login

Download address

https://github.com/swoole/swoole-src/releases
http://pecl.php.net/package/swoole
http://git.oschina.net/matyhtf/swoole
Copy after login

After downloading the source code package, enter the source code directory in the terminal and execute the following commands to compile and install

cd swoole
phpize
./configure
make 
sudo make install
Copy after login

An error will be reported when you make:

error: macro "add_assoc_string" requires 4 arguments, but only 3 given add_assoc_string(return_value, ifa->ifa_name, ip);
Copy after login

Second reinstallation:

Other steps remain unchanged, modify ./configure

./configure --with-php-config=/usr/local/php-5.6.27/bin/php-config
Copy after login

In the above instructions, use php -v to check the version of php in the server,

Then make && make install are executed separately. First execute make, then execute make install.

After make install, the path /usr/local/php/lib/php/extensions/no-debug is prompted. -non-zts-20131226/

Modify extension=swoole.so

extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/swoole.so
Copy after login

service php-fpm restart, no error is reported

php -m, swoole is available.

Check phpinfo, the swoole extension is also available.

Recommended learning: "swoole tutorial"

The above is the detailed content of How to solve the problem that the swoole extension cannot be added. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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