When attempting to execute the command:
composer create-project flarum/flarum . --stability=beta
an error may be encountered:
[RuntimeException] The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true.
Unable to Enable Openssl Despite Modifying "php.ini"
Despite adding "extension=php_openssl.dll" to "php.ini," the error persists.
Solution: Disabling TLS for Temporary Relief
As a temporary solution for non-production environments, consider disabling TLS for Composer:
composer config -g --disable-tls true
Re-run Composer afterwards. This approach is not recommended for production servers due to security implications.
Permanent Resolution: Enabling PHP Openssl
To address the issue permanently, enable the PHP Openssl extension. Ensure the PHP Openssl extension is installed and enabled in the php.ini file.
Adding Openssl Extension to "php.ini"
Reload php-fpm or Web Server
Reload php-fpm or the web server as necessary.
Update for PHP 7.4 and Later
For PHP 7.4 and later, the extension name is simply "openssl," even for Windows.
The above is the detailed content of Why Isn't Composer Recognizing the Openssl Extension Despite Adding It to php.ini?. For more information, please follow other related articles on the PHP Chinese website!