If you need to make modifications to php.ini in your VPS, there are a couple of ways you can find out where it is located:

a) In the command line, run the following command:

php -i | grep php.ini

The following line will be displayed, containing the path of the php.ini file:

Loaded Configuration File => /usr/local/lib/php.ini

Note: yes, the line above does not include the closing php tag. PHP does not require it and it helps to prevent spaces sent to the client before all the headers are sent, a common problem that causes cookies to not be set.

b) you can create a php script with the following content:

<?php phpinfo();

When you access this script from your browser, you will also see “Loaded Configuration File” containing the path of php.ini

Remember it is not possible to modify php.ini in shared hosting accounts. To make changes to the PHP configuration, you will need to do so by putting the directives in .htaccess files.