How to check the PHP version?

慕斯
Release: 2023-03-10 21:02:02
forward
2758 people have browsed it

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

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;
?>
Copy after login

Rendering:

④ Use the phpversion() function to query:

 echo phpversion();
?>
Copy after login

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!

Related labels:
php
source:csdn.net
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!