In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to view the installed version of php". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
View the php version of the method: 1, use the "echo phpinfo ();" statement, you can see the PHP version information in the output results; 2, use the "echo phpversion ();" statement, you can directly output the PHP version number; 3, use the "echo PHP_VERSION;" statement.
Operating environment of this tutorial: windows7 system, PHP5.5.12 version, DELL G3 computer
How to view the installed version of php
1. Use the phpinfo () function to get the PHP version number
When it comes to getting the PHP version number, the first thought is to use the phpinfo () function, which returns information about the PHP configuration.
The output information includes: PHP version, server information and environment variables, PHP environment variables, operating system version information, path and environment variable configuration, HTTP headers, and copyright announcement, and so on.
We just need to output the phpinfo () function directly:
Output result:
2. Use the phpversion () function to get the PHP version number
The phpinfo () function returns too much, so if you just want to get the PHP version number, just use the phpversion () function.
Output result:
3. Use the predefined constant PHP_VERSION
The PHP_VERSION constant can return the version number of the current PHP in the form of a string in the format of "major version number. Child version number. Phase version number [extension Information]".
Output result:
As you can see, the output of the predefined constant PHP_VERSION is the same as the phpversion () function.
In addition to the PHP_VERSION constant can return PHP version information, the predefined constants PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_VERSION_ID, PHP_EXTRA_VERSION can also return part of the PHP version information.
PHP_MAJOR_VERSION (int)
The major version number of the current PHP version, in the form of integers (for example, the "5.2.7-extra" version is int (5)).
PHP_MINOR_VERSION (int)
The child version number of the current PHP version, in the form of an integer (for example, the "5.2.7-extra" version is int (2)).
PHP_RELEASE_VERSION (int)
The phase version number of the current PHP version, in the form of integers (for example, the "5.2.7-extra" version is int (7)).
PHP_VERSION_ID (int)
An integer for the current PHP version for version comparison (for example, the "5.2.7-extra" version is int (50207)).
PHP_EXTRA_VERSION (string)
The "extended information" information for the current PHP version is in the form of a string (for example, the "5.2.7-extra" version is'- extra'). It is usually used by distribution vendors to indicate the version of the package.
That's all for "how to view the installed version of php". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.