Home > Backend Development > PHP Problem > How to check if php is installed

How to check if php is installed

青灯夜游
Release: 2023-03-12 11:46:01
Original
3733 people have browsed it

View method: 1. Directly use echo to output the phpinfo() function, with the syntax "echo phpinfo();"; if configuration information about PHP is returned, php is installed. 2. Directly use echo to output the phpversion() function. If the PHP version number is returned, php is installed.

How to check if php is installed

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

View method 1: Use phpinfo( )Function

Directly output phpinfo() function

<?php
echo phpinfo();
?>
Copy after login

If configuration information about PHP is returned, php is installed.

How to check if php is installed

View method 2: Use the phpversion() function

is also directly output

<?php
header("content-type:text/html;charset=utf-8");
echo "当前PHP的版本为:".phpversion();
?>
Copy after login

If it returns to PHP version number, install php.

How to check if php is installed

Recommended study: "PHP Video Tutorial"

The above is the detailed content of How to check if php is installed. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template