Home > Backend Development > PHP Problem > How to check php version in windows?

How to check php version in windows?

青灯夜游
Release: 2023-02-28 16:20:02
Original
7304 people have browsed it

How to check php version in windows?

Method 1: Use a PHP script to check the PHP version

1. Use phpinfo()

phpinfo is a running command , to display the configuration information of the php server. These include PHP extensions and compiled versions, server information and environment, PHP environment, paths, host and local configuration options, HTTP headers, PHP permissions and more.

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

How to check php version in windows?

2. Use PHP_VERSION

PHP_VERSION is used to obtain the current PHP version number.

<?php
    echo PHP_VERSION;
?>
Copy after login

Output:

5.5.12
Copy after login
Copy after login

3. Use phpversion()

phpversion() to get the current PHP version

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

Output:

5.5.12
Copy after login
Copy after login

Method 2: Check the PHP version through the command line

Use [win r] to open the run window, enter cmd, press Enter, and open the cmd command line

How to check php version in windows?

How to check php version in windows?

If the environment variables have been configured, enter php -v directly on the command line, and the version of php will be displayed. information. If you do not configure environment variables, directly enter the PHP installation directory on the command line, and then enter the query command php -v. After entering the query command in the installation directory, you can see the output version information.

Example:

How to check php version in windows?

The version information is PHP5.3.29

Method 3: The most direct and simple way to check the PHP version

How to check php version in windows?

The above is the detailed content of How to check php version in windows?. 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