0

After changing from XAMPP to MAMP the loaded configuration file isn't loaded in command line.

Runnung php --ini..
Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File:         (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

The php.ini works fine when loaded from localhost with phpinfo();.

Since there is no php.ini I get the following message when running composer command for example..

  [Composer\Exception\NoSslException]
  The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl ex
  tension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true.

Edit: I know that enabling extension=php_openssl.dll will solve the NoSslException in php.ini but the question is how to load the correct php.ini in command line?

mattesj
  • 549
  • 2
  • 8
  • 20
  • php-cli uses its own php.ini file. `php --ini` reported the ini file is found inside `C:\WINDOWS` directory, check there – Ali Feb 05 '18 at 11:34
  • and sometimes you need to reopen the shell or to reload the profile, in order to get the new config work – fucethebads Feb 05 '18 at 11:40
  • @Ali there is no php.ini file in C:\WINDOWS. – mattesj Feb 05 '18 at 11:46
  • @fucethebads I have already restarted the computer, what do you mean by reload profile? – mattesj Feb 05 '18 at 11:47
  • when you open a shell/terminal a context will be opend where some variables are defined. if you change some of them, they wont be refreshed in your context. so to refresh them you have to open a new shell or reload the context. on linux systems the context is knows als profile – fucethebads Feb 05 '18 at 13:36

0 Answers0