If you are using WAMP then type the following in the browser
http://localhost/?phpinfo=-1,
you will get the phpinfo page.
You can also click the localhost icon in the wamp menu from the systray and then find the phpinfo page. WAMP localhost from WAMP Menu
From the CLI the best way is to use grep
like:
php -i | grep libxml
If you have php installed on your local machine try:
$ php -a
Interactive shell
php > phpinfo();
Use the command line.
touch /var/www/project1/html/phpinfo.php && echo '<?php phpinfo(); ?>' >> /var/www/project1/html/phpinfo.php && firefox --url localhost/project1/phpinfo.php
Something like that? Idk!
From the CLI:
php -r 'phpinfo();'
Source: Stackoverflow.com