How to check the php version
##1. Use the php function phpinfo():
The phpinfo function returns all information about PHP, including PHP compilation options and extended configuration, PHP version, server information and environment variables, PHP environment variables, operating system version information, path and environment variable configuration, HTTP tags header, copyright notice and other information.<?php echo phpinfo(); ?>
#2. Use the predefined constant PHP_VERSION to query:
<?php echo PHP_VERSION; ?>
3. Use the phpversion() function to query:
<?php echo phpversion(); ?>
4. Enter php –v on the command line:
as shown below: Note: PHP needs to be configured Environment variablesThe steps to configure PHP environment variables are as follows:①Right-click the "Computer" icon to display the following page: ②Click "Advanced System Settings", the following page appears: ③ Click "Environment Variables", the following page appears:# #④Find the Path line and copy the PHP directory into the small box (note: the added Path and the previous default Path need to be separated by English;):
My PHPPath: F:\ zero_wampserver\wamp\bin\php\php5.5.12
(Just find the directory where php.exe is located)
⑤Click "OK" environment The variable configuration is completed.
For more PHP related knowledge, please visit
php中文网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!