If you’re using shared hosting for your WordPress site, there may come a time when you need to know what PHP version you’re running, as well as any extra modules installed or PHP limitations. You don’t have access to the server to check these things for yourself. Enter the PHP info file.
The PHP info file will give you information about the version of PHP and other software on the server. This in turn can help you know what you can and can’t do on the server. Without further ado, let’s dive into how to make one.
[geoip-content country=”DE”]Guten tag![/geoip-content][geoip-content country=”FR”]Bonjour![/geoip-content]
[geoip-content countrycode=”US” not_state=”TX”]Hello![/geoip-content]
Making a PHP Info File
First, open a text editor capable of making a plain-text file. On Mac you can use TextEdit, and on Windows you can use Notepad. Enter the following text in a new file:
<?php
// Show INFO_ALL
phpinfo();
?>
Save your file as “phpinfo.php” on your computer.
Adding PHP Info File to your Server
Now that you’ve made your file, you’ll need to move it to the server where your website is hosted. The PHP info file should live in the document root, so that you can access it at “yourdomain.com/phpinfo.php” in your web browser. The easiest (and most widely-supported) way to do this would be to transfer the file using SFTP. Grab your SFTP or FTP credentials from your web host, and connect using FileZilla or another similar client.
Drag and drop the phpinfo.php file you saved on your computer over to the document root of your website:
Viewing PHP Info File
So you’ve now created the PHP info file, and transferred it up to your website. Now what? Now it’s time to view the actual information. Just go to “yourdomain.com/phpinfo.php” to view the contents.
And that’s it! You’ve created your phpinfo.php file from start to finish. When you’ve finished with the file it’s best to delete it from your site using SFTP simply for security purposes. If you have any comments, questions, things to add just let me know in the comments, or Contact Me.