In this article, we’ll show you how to create a phpinfo file. Also how to check its detailed information. For example, you might want to check whether your PHP configurations meet the requirements of any software you want to run on your server.
What is phpinfo?
phpinfo() is a function or a code snippet to determine the website’s PHP configuration. Here is some information that the PHP function displays after running phpinfo():
- A version of PHP the website is currently using.
- Server information and environment.
- Operating System version information.
- The PHP environment.
- HTTP headers.
- Modules and extensions.
- Master and local values.
- Paths along with php.ini location.
- The PHP License.
How To Create And Use a phpinfo File?
You often need to check PHP settings during web development. You can do this by running a script that calls the phpinfo() function. When you load the page in a web browser, the script shows all of the PHP configuration settings for your web site.
To use the phpinfo() function to view PHP settings:
- Login to cPanel.
- Navigate to File Manager under the Files section.
- Once you’re in public_html directory, click the New File button.
- Name your file phpinfo.php and press Create.
- Scroll down and locate the new phpinfo file within the directory, then right-click to Edit.
- After that, copy and paste the following code and press Save.
- Use your browser to go to http://test.com/phpinfo.php. where test.com represents your web site’s domain name. The page displays a large amount of information about the PHP installation.