Intro to Linux: PHP information

It’s really common to want to review your php setup.  The easiest way is the php function phpinfo();  the following will run from the command line or from a web browser:

<?php
phpinfo();
?>

Or to just see the modules

<?php
phpinfo(INFO_MODULES);
?>

To run from the command line type

php textfile_name

Since outputting this information can be a security risk avoid running from your webserver unless the directory is secured against random visitors.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.