How to create phpinfo page on Linux server – What does it mean ?

What is phpinfo() function ?

The function phpinfo() displays the current information of PHP, which includes the php extensions and compilations, version, server information and environment (if compiled as a module), the PHP environment, paths, master and local values of configuration options, HTTP headers, and the PHP License etc. You will get the PHP informations not only from the browser but also from the server command-line.

Method I : Get PHP info on browser

In this method, you need to create a file with ‘.php’ extension under the public folder of your website and add the following code.

<? php phpinfo();  ?>

And then access the file from your web-browser.

Method II : Get PHP information on command-line

Yes! there is an option to list PHP info on the command-line. Execute the following command to get the information.

php -r 'phpinfo();'

That’s it 🙂

Related Links:
How to disable phpinfo(); in a shared environment

Post navigation

Arunlal A

Senior System Developer at Zeta. Linux lover. Traveller. Let's connect! Whether you're a seasoned DevOps pro or just starting your journey, I'm always eager to engage with like-minded individuals. Follow my blog for regular updates, connect on social media, and let's embark on this DevOps adventure together! Happy coding and deploying!

One thought on “How to create phpinfo page on Linux server – What does it mean ?

Leave a Reply

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