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.
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.
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.
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!