Avatar ·

How to find out which php.ini the PHP command line uses?

Hello everyone! I'm a beginner PHP developer, working on Windows, using EasyPHP. I've encountered a strange situation: when I run scripts through the browser (Apache), everything works fine, but when I try to run the same script from the command line (cmd), the behavior differs. For example, I enabled the `openssl` extension in php.ini via the EasyPHP panel — it works in the browser, but in the console it says "Fatal error: Uncaught Error: Call to undefined function openssl_encrypt()". I checked phpinfo() via the web — openssl is there. But via `php -m` in the command line, this extension is not present. I realized that the command line is likely using a different php.ini. But how can I find out which configuration file is loaded when calling `php` from the console? I have several PHP versions installed (via EasyPHP).