May 14, 2021 Swoole
1. Swoole compiles the installation steps
6. make or make install could not be executed or compiled incorrectly
7. The mysql header file is missing
8. The pcre.h header file is missing
11.. After modifying the php .ini, there is no swoole in php -m or phpinfo
12.. error: too many arguments to function 'zend_exception_error'
The Swoole extension was built according to the php standard extension. Use phpize to generate php compilation configuration, ./configure to do compilation configuration detection, make to compile, make install to install.
Before installing swoole, you must ensure that the following software is installed in the system
php-5.3.10 或更高版本
gcc-4.4 或更高版本
make
autoconf
After downloading the source code package, enter the source directory at the terminal and execute the following commands for compilation and installation
cd swoole
phpize
./configure
make
sudo make install
(Note: swoole's ./configuration has a lot of extra parameters that can be viewed through the ./--help command, where only the async-mysql item is open, and the others are selected by default) Here are the additional parameters for the ./configure compilation configuration to turn on certain features
The swoole project has been included in PHP's official extension library, in addition to manual download compilation, you can also use PHP official peck command, one-click download installation of swoole
pecl install swoole
After the compilation installation is successful, modify the php .ini join
extension=swoole.so
Use php -m or phpinfo() to see if the swoole was successfully loaded, and if it is not possible that the path to php.ini is not correct, you can use php -i-|grep php.ini to locate the absolute path to php.ini
NOTICE: PHP message: PHP Warning: PHP Startup: swoole: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
The php version does not correspond to the phpize and php-config used at compile time and needs to be compiled using an absolute path. PhP is executed using an absolute path.
/usr/local/php-5.4.17/bin/phpize
./configure --with-php-config=/usr/local/php-5.4.17/bin/php-config
/usr/local/php-5.4.17/bin/php server.php
php_mysqli_structs.h:64:23: fatal error: my_global.h: No such file or directory
The header file for mysqlclient was not found and mysqlclient-dev needs to be installed
It is recommended that you compile your own php and do not use the php version that come with the Linux package management system
fatal error: pcre.h: No such file or directory
The reason is the lack of pcre, which requires the installation of libpcre
The phpize command requires an autoconf tool, please install it first.
make install requires root permissions, if you are not logged in as root users, please use sudo or su, and then install.
php -i|grep php.ini
Look at the loaded php .ini path to confirm that the correct php .ini.
Modify the php .ini, open the error display, and see if there is a startup error.
display_errors => On
display_startup_errors => On
Your PHP version is lower than PHP-5.3.10, please upgrade the PHP version.
Don't be discouraged, join our development group QQ group: 495864936, your problem will be solved within 24 hours.