How to Create a PHP Information File
PHP has many different settings available to a server administrator, enabling it to run in a number of different environments and with different levels of security. Installing the optional extensions can further add to its functionality and increase the number of available commands. While this degree of configurability allows the administrator to optimize the PHP server for many different purposes, it does mean that there is no "standard setup" as such. When you move to a new Web host, view the server's configuration and installed extensions using the "phpinfo" command.
Instructions
-
-
1
Create a new PHP page using a text editor or Web design program.
-
2
Add the following code between the HTML "body" tags:
<?php phpinfo(); ?>
Save the page as "phpinfo.php," and upload it to your Web server.
-
-
3
Open a Web browser and go to the phpinfo.php page on your server. You can view the entire PHP configuration, along with important information such as the server paths needed to configure PHP Web applications.
-
1
Tips & Warnings
If you only need to know the PHP version number, use the "phpversion" command.
Leaving phpinfo.php on your Web server permanently is a security risk, as it shows potential hackers the configuration of the server. Hackers specifically target these files using search engines, so note down the necessary information and then delete the files from the server. Save the page in your Web browser for future reference, so you can refer to your local copy.
References
Resources
- Photo Credit Thinkstock Images/Comstock/Getty Images