which php
php --version

To check php libs that are installed on your server

php -m

To locate php.ini

php --init