How to find my php.ini file remotely using command prompt

  1. Log into your server remotely
  2. Go to your where your website files are
  3. add a file
    $ sudo vi phpinfo.php
  4. Press the i key on your keyboard to enter the following code;
  5. Press esc key to change from insert to command mode.
  6. To save your file
    Type; :wq! and then press enter
  7. Go to your browser,
    Type your domain/phpinfo.php.
    It shall bring the server details as below;
8. Go to the row with
Loaded Configuration File: /etc/php/8.1/fpm/php.ini.
This is the active php.ini file location