Web Hosting

How to Create phpinfo file and Check PHP Configuration

Checking PHP Information by Creating a phpinfo File
In case your hosting platform doesn’t offer the mentioned built-in PHP Info feature, there is no need to worry! You can reach the same goal by creating a phpinfo file in your public_html directory.

The file will be accessible via a browser and will show you the same detailed information.

You will need a way to access your public_html files. Here we’re using Hostinger’s File Manager as an example.

  • Navigate to File Manager under the Files section in your CPanel.
  • 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.
  • Now, copy and paste the following code into the text editor and press Save.

The same result can be achieved by using any text editor on your computer. Create the phpinfo.php file by following the same steps from before, then uploading the file to your server’s public_html folder through an FTP client.

If you don’t know how to configure or never worked with an FTP client, such as FileZilla, refer to our guide for more information.

Checking PHP Information Using a Browser

You should have a phpinfo.php file in your public_html directory by now. So, all that’s left is to access the file by adding /phpinfo.php at the end of your domain name.
You should see a similar view when the file is accessed via any browser:

Note: If you don’t want your phpinfo page to be displayed all the time, you can easily disable the file by giving it a different name. phpinfo.php_disabled, for instance.

Leave a Reply

Your email address will not be published.

Back to top button