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(); ?>
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
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:
The version information is PHP5.3.29
Method 3: The most direct and simple way to check the PHP version
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!