href up test.php,test.php

/**

* 环境监测程序

*/

header('Content-Type: text/html; charset=utf-8');

error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ^ E_STRICT);

ini_set('display_errors', 1);

define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));

define('WEBPATH', dirname(__FILE__).'/');

define('SYSTEMPATH', true);

if (isset($_GET['log']) && $_GET['log']) {

if (!is_file(WEBPATH.'cache/error/log-'.date('Y-m-d').'.php')) {

exit('今天没有错误日志记录');

}

echo nl2br(file_get_contents(WEBPATH.'cache/error/log-'.date('Y-m-d').'.php'));

exit;

}

// 判断环境

if (version_compare(PHP_VERSION, '7.1.0') < 0) {

exit("PHP版本必须在7.2以上");

} else {

dr_echo_msg(1, 'PHP版本:v'.PHP_VERSION);

}

// 扩展

if (!function_exists('intl_is_failure')) {

dr_echo_msg(0, "PHP版本需要安装intl扩展");

}

require WEBPATH.'config/database.php';

$mysqli = function_exists('mysqli_init') ? mysqli_init() : 0;

if (!$mysqli) {

dr_echo_msg(0, 'PHP环境必须启用Mysqli扩展');

}

if ($db['default']['database']) {

if (!@mysqli_real_connect($mysqli, $db['default']['hostname'], $db['default']['username'], $db['default']['password'])) {

dr_echo_msg(0, '['.mysqli_connect_errno().'] - ['.mysqli_connect_error().'] 无法连接到数据库服务器('.$db['default']['hostname'].'),请检查用户名('.$db['default']['username'].')和密码('.$db['default']['password'].')是否正确');

} elseif (!@mysqli_select_db($mysqli, $db['default']['database'])) {

dr_echo_msg(0, '指定的数据库('.$db['default']['database'].')不存在');

} else {

if ($result = mysqli_query($mysqli, "SELECT id FROM ".$db['default']['DBPrefix']."member LIMIT 1")) {

dr_echo_msg(1, 'MySQL数据连接正常');

} else {

dr_echo_msg(0, '数据库('.$db['default']['database'].')查询异常:'.mysqli_error($mysqli));

}

mysqli_close($mysqli);

}

}

$post = intval(@ini_get("post_max_size"));

$file = intval(@ini_get("upload_max_filesize"));

if ($file > $post) {

dr_echo_msg(1,'系统配置不合理,post_max_size值('.$post.')必须大于upload_max_filesize值('.$file.')');

}

if ($file < 10) {

dr_echo_msg(1,'系统环境只允许上传'.$file.'MB文件,可以设置upload_max_filesize值提升上传大小');

}

if ($post < 10) {

dr_echo_msg(1,'系统环境要求每次发布内容不能超过'.$post.'MB(含文件),可以设置post_max_size值提升发布大小');

}

if (!function_exists('mb_substr')) {

dr_echo_msg(0, 'PHP不支持mbstring扩展,必须开启');

}

if (!function_exists('curl_init')) {

dr_echo_msg(0, 'PHP不支持CURL扩展,必须开启');

}

if (!function_exists('mb_convert_encoding')) {

dr_echo_msg(0, 'PHP的mb函数不支持,无法使用百度关键词接口');

}

if (!function_exists('imagecreatetruecolor')) {

dr_echo_msg(0,'PHP的GD库版本太低,无法支持验证码图片');

}

if (!function_exists('ini_get')) {

dr_echo_msg(0, '系统函数ini_get未启用,将无法获取到系统环境参数');

}

if (!function_exists('gzopen')) {

dr_echo_msg(0,'zlib扩展未启用,您将无法进行在线升级、无法下载应用插件等');

}

if (!function_exists('gzinflate')) {

dr_echo_msg(0,'函数gzinflate未启用,您将无法进行在线升级、无法下载应用插件等');

}

if (!function_exists('fsockopen')) {

dr_echo_msg(0,'PHP不支持fsockopen,可能充值接口无法使用、手机短信无法发送、电子邮件无法发送、一键登录无法登录等');

}

if (!function_exists('openssl_open')) {

dr_echo_msg(0,'PHP不支持openssl,可能充值接口无法使用、手机短信无法发送、电子邮件无法发送、一键登录无法登录等');

}

if (!ini_get('allow_url_fopen')) {

dr_echo_msg(0,'allow_url_fopen未启用,远程图片无法保存、网络图片无法上传、可能充值接口无法使用、手机短信无法发送、电子邮件无法发送、一键登录无法登录等');

}

if (!class_exists('ZipArchive')) {

dr_echo_msg(0,'php_zip扩展未开启,无法使用应用市场功能');

}

// 存在错误日志

if (is_file(WEBPATH.'cache/error/log-'.date('Y-m-d').'.php')) {

$log = file_get_contents(WEBPATH.'cache/error/log-'.date('Y-m-d').'.php');

dr_echo_msg(1, '系统故障的错误日志记录:查看日志');

}

// 输出

function dr_echo_msg($code, $msg) {

echo '

';

if (!$code) {

echo ''.$msg.'';

} else {

echo ''.$msg.'';

}

echo '

';

}

echo '

';

echo '如果以上提示文字是红色选项,就必须修改正确的环境配置 (*^▽^*) ,当网站正式上线后,请删除本文件吧~';

echo '

';

一键复制

编辑

Web IDE

原始数据

按行查看

历史

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值