How do I create a phpinfo file?
When troubleshooting a website, it can sometimes be useful to have all the latest PHP configurations for a specific folder or file in one place. This can be done with the php function phpinfo can be reached. Among other things, this function can display the currently loaded PHP modules, the currently loaded PHP settings, and the preset and environment variables.
Retrieve or create the file
In its simplest form, a phpinfo file consists of only a single command:

Here we add a comment and some blank lines to make it easier to read. You need to copy and paste this text into a text file.
If you create the file yourself, make sure that the entire file contains only the exact text from the code field above contains. Make sure that there are no additional invisible characters. Sometimes text editors like Notepad can insert extra characters into files. If you are creating the file on a Windows computer, you should use a different text editor like Notepad++. It is also very important that the file name ends with .php and not .php.txt. Depending on your operating system, you may need to check that your file manager is configured to display file extensions.
Upload the file
Once the phpinfo file is created, it can be uploaded somewhere in the document root of the website. For cPanel Server the cPanel file manager probably one of the easiest ways to do this. If you are familiar with FTP or Web Disk, for example, these should work as well. Make sure the user and group that owns the file are set to the cPanel user and that the file permissions are 644. How you check and adjust this depends on the method you use to upload the file.
Open file
Once the file has been uploaded with the correct permissions and ownership, you can view your new phpinfo page using your web browser. For example, if the file was placed on the server at /home/cpuser/public_html/phpinfo.php, the URL might be http://meinedomain.ch/phpinfo.php. If the file was uploaded correctly, it should look like several tables, with setting/variable names in the left column and values in one or two columns on the right. If you are looking for a specific parameter, you can use your web browser's search function to find it.

Delete the file
It is very important to phpinfo file for no longer than necessary. The information it contains can be very useful for you when troubleshooting, but it can also be very useful for potential attackers who might try to get information from your server about the installed versions or modules, which could give them clues about the type of attacks they are trying to launch. Using a phpinfo file for a short time to get information about the PHP environment during debugging is usually safe, but it is important to keep the file remove (or block access to) itonce you no longer need them. There are several ways to do this.
Advanced application
Advanced users can instruct the phpinfo function to print only certain information. For this purpose the function has a parameter to which you can add in the PHP documentation find more information. For most users, the default setting should work.
Another thing that advanced users can occasionally try is using the phpinfo function within existing scripts. Since PHP scripts can sometimes modify some of the PHP functions, it can be a problem when using the Debugging certain scripts be useful to insert phpinfo lines into these scripts to check that the environment still has the same settings and variable values at certain points as expected by the script. In this case, be sure to remove these extra debugging function calls when you are done.