Test PHP Installation With a Phpinfo page under UNIX / Linux Apache, Nginx, Lighttpd Web server

‮tth‬ps://www.lautturi.com
Test PHP Installation With a Phpinfo page under UNIX / Linux Apache, Nginx, Lighttpd Web server

To test your PHP installation with a PHPinfo page under a Unix or Linux Apache, Nginx, or Lighttpd web server, you can follow these steps:

  1. Make sure that your web server and PHP are properly installed and configured on your system. Consult the documentation of your web server and PHP for more information on how to install and configure them.

  2. Create a new PHP file in the document root of your web server. The document root is the directory where your web server looks for the files to serve to clients. The location of the document root depends on your web server and the configuration of your system. For example, on a system that uses Apache with the default configuration, the document root is typically located at "/var/www/html".

  3. Open the PHP file in a text editor and add the following code to it:

<?php
phpinfo();
?>

This will display information about your PHP installation, including the version of PHP, the configuration settings, and the loaded modules.

  1. Save the PHP file and give it a name that ends in ".php", for example "phpinfo.php".

  2. Open a web browser and access the PHP file from the web server. For example, if your web server is running on the same machine as the client and you have saved the PHP file as "phpinfo.php" in the document root, you can access it by visiting "http://localhost/phpinfo.php" in your web browser.

If the PHP installation is properly configured and working, you should see a page with information about your PHP installation. Consult the documentation of the "phpinfo" function for more information on the information that is displayed by the PHPinfo page.

With these steps, you should be able to test your PHP installation with a PHPinfo page under a Unix or Linux Apache, Nginx, or Lighttpd web server. Consult the documentation of your web server and PHP for more information on how to install, configure, and use them.

Created Time:2017-10-30 14:27:21  Author:lautturi