You can simply write a wonderful program, but it will not work hard, because the PHP version will be unstable or simply incompatible (old, for example). To understand the established problem without additional assistance and information, often impossible. Therefore, techniques that allow you to find out the PHP version on the server will be useful to each person containing either planning to contain its own web server on the Internet.
Create a separate page on the server, the code "phpinfo"
Easy to understand the wilds installed on the server versions of the basic programs using a simple team, phpinfo.For this, it is necessary to fulfill only a few simple actions:
- we will open a notebook program, even the usual text editor of Windows will suit, although the use of its extended version is considered a good tone among programmers, NotePad ++.;
- denote to the server engine part of the code that it must interpret as PHP language:
\u003c? PHP.
?>
- in the middle of the designated text insert a simple command phpinfo () or phpVersion (), At the end you do not forget to put ";", which allows the "machine" to go to reading another line of text. As a result, the following should be:
\u003c? PHP.
phpinfo (); either phpversion ()
?>
- save the file with the extension * .php.. For convenience, it can be called phpinfo.;
- you only have to download the file to the server and enter the link to it into the address bar of the browser;
- the result will be a convenient window formed in the form of a plate and displays comprehensive information on an exciting issue, and even more.

Find out the PHP version, if something went wrong
It happens that all of the above-mentioned actions of you were fulfilled correctly, but it did not work out to achieve the desired result. Do not be upset, the reasons may be somewhat, we advise you to pay attention to the following points:
- message Parse Error It is explicitly hinting on the syntax error. Accidentally, but still some part of the machine text is written incorrectly. Very often, programmers forget about the ill-fated ";", which each individual team should end, for example. Check again the content of the text file;
- it can also happen such that you just see a naked machine code written before you. This is a clear sign that PHP on the server is turned off or not supported. We advise in this case to refer to the administration of hosting for clarification.
Server Command Console, PHP Version Tools
It is not always convenient or the opportunity to find out the version on the server using the command phpinfo (). If there is access to the VPS administrator console, then find the PHP version is even easier. What is the command php -V.. Additional attribute i. (php -i.) Displays the advanced information showing the options of the server itself.
The console is also convenient to export information into a text document in a simple way. For which the above team requires only a few modified. Command php -i \u003e\u003e info.txt Will output all the parameters relating to the version of PHP and server settings in a text document with the title info.
Find out the PHP version is not so difficult. To do this, there are commands both in the Console Administrator's VPS and the PHP language team that form a convenient sign with comprehensive information that can be viewed in your Internet browser. It is worth remembering that the PHP version is lower than 5.2 today is considered outdated. But this does not mean that the latest updates in PHP should be chased, because happiness in stability.
phpinfo () works. Thanks!