How to check php version

藏色散人
Release: 2023-02-24 10:50:02
Original
25358 people have browsed it

How to check php version

How to check the php version

Method 1: Command line query

If the environment variables have been configured, enter php -v directly on the command line, and the version information of php will be displayed. If you do not configure environment variables, directly enter the php installation directory on the command line, and then enter the command php -v. As shown in the figure, I enter the query command in the installation directory, and you can see that the output version information is PHP5. 3.29.

How to check php version

Method 2: Use the predefined constant PHP_VERSION to query

Create a new php file and enter

<?php     
echo PHP_VERSION;
?>
Copy after login

As shown below.

How to check php version

Output the corresponding URL in the browser, and you can view the PHP version information, as shown in the figure below.

How to check php version

Method 3: Use the phpversion() function to query

Create a new php file and enter

<?php     
echo phpversion();
?>
Copy after login
# in the file

How to check php version

##Access in the browser, you can see the PHP version information returned on the browser page, which is the same as the predefined constant PHP_VERSION, as shown in the figure below

How to check php version

Method 4: Use the phpinfo() function to query

Create a new php file and enter

<?php     
echo phpinfo();
?>
Copy after login

## in the file How to check php version#Access in the browser, you can see not only the version information of PHP, but also a lot of other information about PHP, as shown in the figure below.

How to check php versionFor more PHP knowledge, please visit

PHP Tutorial

!

The above is the detailed content of How to check php version. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template