When most novices install the Swoole extension, they will only use pecl to install it, and also add some compilation parameters, such as openssl
Use the command Installation: (Recommended learning: swoole video tutorial)
pecl install swoole
There are several question and answer options when using pecl for installation
enable sockets supports? [no] : enable openssl support? [no] : enable http2 support? [no] : enable mysqlnd support? [no] :
These are used to enable certain features, such as openssl to enable SSL support. Most novices will choose yes here, and then start compiling
The result is that an error is reported: error "Enable openssl support, require openssl library." (The specific error message will not be written in detail, but it is probably like this) It means that when you open openssl, it is not found under the regular path. You need to manually specify the path of the openssl library
or fatal error: ' openssl/ssl.h' file not found
This means that you did not add the path to the openssl library or specified the wrong path to the openssl library. The header file is missing
So it was installed in pecl How to enable adding this path? Isn’t it just yes or no?
The answer can of course be added, we can follow yes followed by the path parameter: --with-openssl-dir=/opt/openssl/, replace it with your openssl library path
检查: php --ri swoole
The above is the detailed content of Does the swoole environment support openssl?. For more information, please follow other related articles on the PHP Chinese website!