Home>Article>PHP Framework> How to solve the problem that the swoole extension cannot be added
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".
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
Download address
https://github.com/swoole/swoole-src/releases http://pecl.php.net/package/swoole http://git.oschina.net/matyhtf/swoole
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
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);
Second reinstallation:
Other steps remain unchanged, modify ./configure
./configure --with-php-config=/usr/local/php-5.6.27/bin/php-config
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
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!