其实小京东后台首页确实了获取系统信息的代码,这里公布给大家:
[PHP] 纯文本查看 复制代码 $mysql_ver = $db->version(); // 获得 MySQL 版本
/* 系统信息 */
$sys_info['os'] = PHP_OS;
$sys_info['ip'] = $_SERVER['SERVER_ADDR'];
$sys_info['web_server'] = $_SERVER['SERVER_SOFTWARE'];
$sys_info['php_ver'] = PHP_VERSION;
$sys_info['mysql_ver'] = $mysql_ver;
$sys_info['zlib'] = function_exists('gzclose') ? $_LANG['yes']:$_LANG['no'];
$sys_info['safe_mode'] = (boolean) ini_get('safe_mode') ? $_LANG['yes']:$_LANG['no'];
$sys_info['safe_mode_gid'] = (boolean) ini_get('safe_mode_gid') ? $_LANG['yes'] : $_LANG['no'];
$sys_info['timezone'] = function_exists("date_default_timezone_get") ? date_default_timezone_get() : $_LANG['no_timezone'];
$sys_info['socket'] = function_exists('fsockopen') ? $_LANG['yes'] : $_LANG['no'];
if ($gd == 0)
{
$sys_info['gd'] = 'N/A';
}
else
{
if ($gd == 1)
{
$sys_info['gd'] = 'GD1';
}
else
{
$sys_info['gd'] = 'GD2';
}
$sys_info['gd'] .= ' (';
/* 检查系统支持的图片类型 */
if ($gd && (imagetypes() & IMG_JPG) > 0)
{
$sys_info['gd'] .= ' JPEG';
}
if ($gd && (imagetypes() & IMG_GIF) > 0)
{
$sys_info['gd'] .= ' GIF';
}
if ($gd && (imagetypes() & IMG_PNG) > 0)
{
$sys_info['gd'] .= ' PNG';
}
$sys_info['gd'] .= ')';
}
/* IP库版本 */
$sys_info['ip_version'] = ecs_geoip('255.255.255.0');
/* 允许上传的最大文件大小 */
$sys_info['max_filesize'] = ini_get('upload_max_filesize');
$smarty->assign('sys_info', $sys_info);
还是老话搞不定的10元帮你搞定,直接注册本站即可
|