進入源碼包
cd php-7.1.9/ext/openssl
會發(fā)現(xiàn)有很多內置的擴展,這里我們編譯的是openssl擴展.
編譯
phpize
./configure --with-php-config=/usr/local/php7/bin/php-config
make && make install
添加配置
最后在php.ini中添加擴展
extension = "openssl.so"
遇到的問題
Cannot find config.m4.
Make sure that you run /usr/local/bin/phpize in the top level source
解決的方法是:在源碼包中的openssl文件夾中將config0.m4重命名為confing.m4.執(zhí)行下面的語句也可以.
cp ./config0.m4 ./config.m4 復制
最后要重啟各種服務.