How to obtain server operating system related information in php

高洛峰
Release: 2023-03-03 17:54:01
Original
1464 people have browsed it

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; ?>
Copy after login

ZEND version:

<?PHP echo zend_version(); ?>
Copy after login

MYSQL support:

<?php echo function_exists (mysql_close)?"是":"否"; ?>
Copy after login

MySQL database continuous connection:

<?php
echo @get_cfg_var("mysql.allow_persistent")?"是 ":"否";
?>
Copy after login

Maximum number of MySQL connections:

<?php
echo @get_cfg_var("mysql.max_links")==-1 ? "不限" : @get_cfg_var("mysql.max_links");
?>
Copy after login

Server operating system:

<?PHP echo PHP_OS; ?>
Copy after login

Server information:

<?PHP echo $_SERVER [&#39;SERVER_SOFTWARE&#39;]; ?>
Copy after login

Maximum upload limit:

<?PHP
echo get_cfg_var ("upload_max_filesize")?get_cfg_var ("upload_max_filesize"):"不允许上传附件";
?>
Copy after login

Maximum execution time:

<?PHP echo get_cfg_var("max_execution_time")."秒 "; ?>
Copy after login

Maximum memory occupied by script running:

<?PHP
echo get_cfg_var ("memory_limit")?get_cfg_var("memory_limit"):"无"
?>
Copy after login

Query the version of the currently connected MYSQL database php comes with the function

mysql_get_server_info()
Copy after login

Get the service

date_default_timezone_set (PRC);
echo date("Y-m-d G:i:s");
Copy after login
Copy after login

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");
Copy after login
Copy after login

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!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!