美文网首页
获取系统信息

获取系统信息

作者: yuanlu954 | 来源:发表于2019-02-10 21:14 被阅读0次

public function getOS()

{

        $info = array(

            '操作系统'=>PHP_OS,

            'PHP版本'=> PHP_VERSION,

            'MYSQL版本'=>  $this-> _mysql_version(),

//            'Apache版本'=> apache_get_version(),

            '运行环境'=>$_SERVER["SERVER_SOFTWARE"],

            'PHP运行方式'=>php_sapi_name(),

            'ThinkPHP版本'=>THINK_VERSION.' [ <a href="http://thinkphp.cn" target="_blank">查看最新版本</a> ]',

            '上传附件限制'=>ini_get('upload_max_filesize'),

            '执行时间限制'=>ini_get('max_execution_time').'秒',

            '服务器时间'=>date("Y年n月j日 H:i:s"),

            '服务器域名/IP'=>$_SERVER['SERVER_NAME'].' [ '.gethostbyname($_SERVER['SERVER_NAME']).' ]',

            '剩余空间'=>round((disk_free_space(".")/(1024*1024)),2).'M',

            'register_globals'=>get_cfg_var("register_globals")=="1" ? "ON" : "OFF",

            'magic_quotes_gpc'=>(1===get_magic_quotes_gpc())?'YES':'NO',

            'magic_quotes_runtime'=>(1===get_magic_quotes_runtime())?'YES':'NO',

        );

        $this->assign('OS_info',$info);

    }

    private function _mysql_version()

{

        $db_info =  include(APP_PATH.'/database.php');

        $con = mysqli_connect($db_info['hostname'],$db_info['username'],$db_info['password']);

        $version = mysqli_get_server_info($con);

        mysqli_close($con);

        return  $version;

    }

相关文章

网友评论

      本文标题:获取系统信息

      本文链接:https://www.haomeiwen.com/subject/prgxeqtx.html