Home  >  Article  >  Backend Development  >  How to check if php is installed

How to check if php is installed

青灯夜游
青灯夜游Original
2021-09-09 11:56:393697browse

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

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

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!

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