问题
i have UwAmp installed. and i'm using php cli command with composer, it says 'you must enable openssl extension'.
i'm sure i was enabled openssl in all php ini every version i have.
how to enable openssl for uwamp cli?
回答1:
I had the same problem using UwAmp whilst trying to install composer, but found that I needed to add one more step before I could get it to work on my system.
After you identify the php_uwamp.ini file and copy it to the same directory as php.ini (as suggested) you need to find the following line
extension_dir = "{PHPEXTPATH}"
and change it to
extension_dir = "./ext"
The {PHPEXTPATH} variable is not interpreted when php is run under the CLI, and composer will complain about missing modules if you don't do this.
回答2:
While asking this question I already found the answer:
- Make sure openssl is enabled using the GUI
- Find uwamp-directory/php/php-x.x.x/php_uwamp.ini
- Copy it to php.ini in the same directory
Done.
回答3:
If you use UwAmp, the installer Composer will struggle to find the php.ini file, even if you add the PHP folder to your PATH, because it just does not exist! The installer will display an error in the activation of the OpenSSL extension of PHP.
To resolve this issue, go to the folder of the PHP version used by UwAmp. Then copy the php_initial.ini file in the same folder and rename it to php.ini.
Then check the new php.ini the extension_dir variable is set to "ext", so you can install Composer normally.
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; On windows:
extension_dir = "ext"
original source for solution (in french): http://baudet.me/2014/10/installer-et-utiliser-composer-avec-uwamp/
来源:https://stackoverflow.com/questions/18892831/how-to-enable-openssl-in-uwamp-cli