Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an easy way of seeing PHP info?

Tags:

php

phpinfo

People also ask

How can I see info in PHP?

Checking PHP Information Using Hosting Control Panel Once you're logged in, scroll down and go to Advanced -> PHP Info. You'll then be forwarded to a page with detailed information about your current PHP version, modules, and values, etc. Scroll down to browse for more.

How do I find PHP information in terminal?

Open a bash shell terminal and use the command “php –version” or “php -v” to get the version of PHP installed on the system.

How do I find Phpinfo on Windows?

Check PHP Version by Running PHP Codephp echo 'PHP version: ' . phpversion(); Create the file using a text editor like gedit or Notepad, and upload it to your website's document root directory. Note: While phpinfo() is useful for debugging, the page features sensitive information about your system.


From your command line you can run..

php -i

I know it's not the browser window, but you can't see the phpinfo(); contents without making the function call. Obviously, the best approach would be to have a phpinfo script in the root of your web server directory, that way you have access to it at all times via http://localhost/info.php or something similar (NOTE: don't do this in a production environment or somewhere that is publicly accessible)

EDIT: As mentioned by binaryLV, its quite common to have two versions of a php.ini per installation. One for the command line interface (CLI) and the other for the web server interface. If you want to see phpinfo output for your web server make sure you specify the ini file path, for example...

php -c /etc/php/apache2/php.ini -i 

If you have php installed on your local machine try:

$ php -a
Interactive shell

php > phpinfo();

From the CLI the best way is to use grep like:

php -i | grep libxml

From the CLI:

php -r 'phpinfo();'