img

Test PHP Installation With a Phpinfo page under UNIX / Linux Apache Web Server

September 8, 2019

How do I test php installation with a phpinfo() page under UNIX / Linux Apache / nginx / lighttpd web server?

PHP has a special function called phpinfo(). It displays a large amount of information about the current state of PHP. This includes information about PHP compilation options and extensions, the PHP version, server information and environment, OS version information, paths, master and local values of configuration options, HTTP headers, and the PHP License etc.

Create following test.php script in your /var/www/html directory (or your httpdoc directory) or upload the same using ftp / sftp / scp client:

<?php
 phpinfo();
?>

Open your web browser and type the url: http://example.com/test.php.
Sample outputs:

Fig.01: phpinfo script output

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Article Tags:
Article Categories:
How To

Comments are closed.