[php] phpinfo() - is there an easy way for seeing it?

Each time I want to see the phpinfo(); I have to:

  • Create a info.php file;
  • Write phpinfo(); in it.
  • Go to the browser and type my "thisproject.dev/info.php"

I'm on Ubuntu.

Isn't there a more practical way to see phpinfo in the browser?

This question is related to php phpinfo

The answer is


If you are using WAMP then type the following in the browser
http://localhost/?phpinfo=-1, you will get the phpinfo page.

phpinfo() from localhost

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();'