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

How to check php version in windows?

青灯夜游
青灯夜游Original
2019-11-21 14:10:047303browse

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();
?>

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;
?>

Output:

5.5.12

3. Use phpversion()

phpversion() to get the current PHP version

<?php
    echo phpversion();
?>

Output:

5.5.12

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!

Statement:
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