今天使用composer update發現報錯:The openssl extension is required for SSL/TLS protection but is not available
網上很多人說開啟“extension = php_openssl.dll”,事實上我的已經是開啟的,錯誤依舊提示。廢話不說了
本地開發,我是關閉Composer的TLS來修復,注意:它不安全
composer config -g -- disable-tls true
同時開啟php.ini中的
extension=openssl
特別提醒:
如果設置為true,則將使用HTTP嘗試所有HTTPS URL,而不執行網絡級加密。啟用這是一個安全風險,不推薦。更好的方法是在php.ini中啟用php_openssl和openssl擴展。
附最終結果圖: