From this article, you will know how to use the phpinfo() function to view detailed information about the PHP environment, settings, and more other.
Viewing PHP settings with phpinfo Function
During web development, you need to check your PHP settings as often as possible. To do this, run a script that calls the phpinfo() function. When you load a page in a web browser, the script shows all the PHP configuration settings for your website.
How to use the phpinfo() function to view PHP settings:
- Create a file containing the following code:
<?php phpinfo(); ?>
- Save the file as info.php or something similar.
- Upload the file to your public_html directory.
- In a browser, navigate to http://example.com/info.php, where example.com is your website’s domain name. The page displays a lot of information about installing PHP.
For security reasons, you should disable any calls to the phpinfo() function when website development and testing are complete.
For more information about the phpinfo() function, please visit http://www.php.net/manual/en/function.phpinfo.php.