大多數(shù)新手在安裝 Swoole 擴展時,都只會使用 pecl 進行安裝,還要增加一些編譯參數(shù),比如 openssl
使用命令進行安裝: (推薦學習: swoole視頻教程)
pecl install swoole
在使用 pecl 進行安裝時有幾個問答選項
enable sockets supports? [no] : enable openssl support? [no] : enable http2 support? [no] : enable mysqlnd support? [no] :
這些是用于開啟某些特性,比如 openssl 是來啟用 SSL 支持,大多數(shù)新手在這里都會選擇 yes,之后就開始編譯了
結果發(fā)現(xiàn)報錯了:error "Enable openssl support, require openssl library."(具體的錯誤信息就不詳細寫了,大概是這樣)意思就是說你開啟 openssl,常規(guī)路徑下沒有找到,需要你手動指定 openssl 庫的路徑
或者fatal error: 'openssl/ssl.h' file not found
這個意思是你沒有加 openssl 庫的路徑或者指定 openssl 庫的路徑不對,缺少頭文件
那么在 pecl 安裝的時候怎么開啟添加這個路徑呢?不是只能 yes 或者 no 嗎?
答案是當然可以添加的,我們可以在 yes 后面跟上路徑參數(shù): --with-openssl-dir=/opt/openssl/,替換為你的 openssl 庫路徑
檢查: php --ri swoole
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com