Sometimes, we need to know the PHP interpreter information and parameters of our web server. Knowing these parameters helps us to determine the status of the server, the possible causes of some problems and as information necessary to be able to configure the server correctly depending on our needs.
If we don’t know how to access this information, we need to resort to asking our Hosting provider or accessing our Web Hosting dashboard. To simplify this task, here’s how to view all the PHP interpreter information on the server.
Within the PHP language, there is a specific function to display all server information. This function is called phpinfo
In order to implement the function we must do the following:
Create a file with the .php extension and name it that identifies it, for example “phpinfo”. It can be done via FTP or the File Manager of the Hosting dashboard.
Edit the contents of the file and insert the following code:
<?php phpinfo(); ?>
Save the changes and save the file inside the home directory of the website (On most servers it is usually the httpdocsdirectory).
Run the created file by typing in the browser the path of the file with its extension. Example: www.midominio.com/phpinfo.php
Note: Replace “midominio.com” with the name of the domain where the file you created is hosted.
If you’ve done the steps correctly, running the file gives you content similar to the one shown below:
What if you have followed all the steps correctly but running the file displays a blank screen?
On some servers, for security reasons the phpinfo() function is disabled,for that reason if you try to run the function, a blank screen will appear.
In that case, in order to enable the feature, you’ll need to contact your Web Hosting provider to enable the phpinfo() function and successfully run it from the file you created by following the steps in this tutorial.