Home > Article > Backend Development > How to obtain server operating system related information in php
The example in this article describes how PHP obtains information related to the server operating system. Share it with everyone for your reference, the details are as follows:
The following is the basic statement for PHP to obtain the current server information.
PHP program version:
<?PHP echo PHP_VERSION; ?>
ZEND version:
<?PHP echo zend_version(); ?>
MYSQL support:
<?php echo function_exists (mysql_close)?"是":"否"; ?>
MySQL database continuous connection:
<?php echo @get_cfg_var("mysql.allow_persistent")?"是 ":"否"; ?>
Maximum number of MySQL connections:
<?php echo @get_cfg_var("mysql.max_links")==-1 ? "不限" : @get_cfg_var("mysql.max_links"); ?>
Server operating system:
<?PHP echo PHP_OS; ?>
Server information:
<?PHP echo $_SERVER ['SERVER_SOFTWARE']; ?>
Maximum upload limit:
<?PHP echo get_cfg_var ("upload_max_filesize")?get_cfg_var ("upload_max_filesize"):"不允许上传附件"; ?>
Maximum execution time:
<?PHP echo get_cfg_var("max_execution_time")."秒 "; ?>
Maximum memory occupied by script running:
<?PHP echo get_cfg_var ("memory_limit")?get_cfg_var("memory_limit"):"无" ?>
Query the version of the currently connected MYSQL database php comes with the function
mysql_get_server_info()
Get the service
date_default_timezone_set (PRC); echo date("Y-m-d G:i:s");
The version of the MYSQL database php Bring your own The function mysql_get_server_info()
gets the server system time
date_default_timezone_set (PRC); echo date("Y-m-d G:i:s");
I hope this article will be helpful to everyone in PHP programming.
For more articles on how PHP can obtain information about the server operating system, please pay attention to the PHP Chinese website!