search
HomeBackend DevelopmentPHP ProblemHow to check php version?

How to check php version?

Oct 16, 2019 pm 03:43 PM
php

How to check php version?

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

Effect screenshot:

How to check php version?

#2. Use the predefined constant PHP_VERSION to query:

<?php
echo PHP_VERSION;
?>

Effect picture:

How to check php version?

3. Use the phpversion() function to query:

<?php
    echo phpversion();
?>

Rendering:

How to check php version?

4. Enter php –v on the command line:

as shown below:

How to check php version?

Note: PHP needs to be configured Environment variables

The steps to configure PHP environment variables are as follows:

①Right-click the "Computer" icon to display the following page:

How to check php version?

②Click "Advanced System Settings", the following page appears:

How to check php version?

③ Click "Environment Variables", the following page appears:

How to check php version?# #④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)

How to check php version?⑤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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft