Home>Article>Backend Development> How to check the PHP version?
We have learned so much about PHP, but I don’t know how you check the PHP version. This article will lead you to check the PHP version more accurately. Come and learn together.
How to check the PHP version:
1. Use the php function phpinfo():
echo phpinfo();
?>
Screenshot of the effect:
2. Enter php –v:
on the command line as shown below:
Note: PHP environment variables need to be configured
The steps to configure PHP environment variables are as follows:
①Right-click The "Computer" icon displays the following page:
② Click "Advanced System Settings" and the following page appears:
③Click "Environment Variables" and the following page will appear:
④Find the Path line and copy the PHP directory Just enter 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.exeis located)
⑤Click "OK" to complete the environment variable configuration.
3. Use the predefined constant PHP_VERSION to query:
echo PHP_VERSION;
?>
Rendering:
④ Use the phpversion() function to query:
echo phpversion();
?>
Rendering:
Related learning video sharing:php Video tutorial
The above is the detailed content of How to check the PHP version?. For more information, please follow other related articles on the PHP Chinese website!