Home >Backend Development >PHP Tutorial >Why am I getting an 'SSL/TLS Protection Error' when creating a Flarum project with Composer?
The Issue:
When attempting to create a new Flarum project using Composer, users may encounter the following error:
The openssl extension is required for SSL/TLS protection but is not available.
This error indicates that the PHP OpenSSL extension, necessary for secure network communication, is not enabled in the PHP configuration.
The Solution:
Disable TLS for Composer (Unsecured):
Warning: This method is not recommended for production environments and should only be used on development machines where security is not a major concern.
composer config -g -- disable-tls true
Enable PHP OpenSSL Extension:
To properly enable OpenSSL, users should ensure that the PHP OpenSSL extension is both installed and enabled in their php.ini file.
Linux/OSX: Add or uncomment the following line in php.ini:
extension=php_openssl.so
Windows: Add or uncomment the following line in php.ini:
extension=php_openssl.dll
Reload the web server or PHP-FPM to apply the changes.
Note: In PHP versions 7.4 and above, the extension name is extension=openssl instead.
Restart Composer:
After making the necessary changes, restart Composer to resolve the error.
Additional Notes:
It is highly recommended to enable the PHP OpenSSL extension for secure network communication. Disabling TLS for composer should only be considered a temporary solution for development environments.
The above is the detailed content of Why am I getting an 'SSL/TLS Protection Error' when creating a Flarum project with Composer?. For more information, please follow other related articles on the PHP Chinese website!