ecshop助理上传报错 无法连接服务器:XML 文档只能有一个顶层元素。line2 <b> Deprecated</b>:Assignig the Deprecated</b>: 7510

本文介绍了解决PHP 5.3及以上版本中出现的Deprecated: Assigning the return value of new by reference is deprecated警告的方法。提供两种解决方案:降级PHP版本或修改代码中的引用符号。
无法连接服务器:XML 文档只能有一个顶层元素。line2    <b>  Deprecated</b>:Assignig the  return



很多朋友的php程序当php的版本升级到5.3以后,会出现”Deprecated: Assigning the return value of new by reference is deprecated in“ 显示出来。这是因为5.3以后,不能使用”=&”符号,可以直接用”=”就可以了。


所以当出现这个问题后有两种解决方法:


1. 把php的版本降级到5.3以下,但后退的不是明智的选择。


2.  对程序中”=&”符号全部用”=” 代替。
 
http://www.tulongzhiji.com/php-deprecated-assigning-the-return-value-of-new-by-reference-is-deprecated-in/
昨晚用Spreadsheet_Excel_Reader导入EXCEL内容到数据库的时候,出现了以下提示:


Deprecated: Assigning the return value of new by reference is deprecated in


定位到出错的那一行:


1  $this->_ole =& new OLERead(); 


我本地环境用的是PHP/5.3.3。


下面这段话引用于因思而变


解决办法:php5.3开始后,废除了php中的”=&”符号,所以要想复制,直接用=引用即可。详细如下:


1、PHP5对象复制是采用引用的方式;
2、如果不采用引用方式,则需要在复制对象时加关键字 clone;

3、如果在复制的过程中,同时要变更某些属性,则增加函数_clone();



7510行去掉 &

<?xml version="1.0" encoding="UTF-8"?> <!-- This file stores bootstrap properties needed by Openfire. Property names must be in the format: "prop.name.is.blah=value" That will be stored as: <prop> <name> <is> <blah>value</blah> </is> </name> </prop> Most properties are stored in the Openfire database. A property viewer and editor is included in the admin console. --> <!-- root element, all properties must be under this element --> <jive> <!-- 核心:添加主目录及路径配置(解决启动失败问题) --> <home>/opt/openfire</home> <logdir>${openfire.home}/logs</logdir> <configdir>${openfire.home}/conf</configdir> <pluginsdir>${openfire.home}/plugins</pluginsdir> <resourcesdir>${openfire.home}/resources</resourcesdir> <adminConsole> <!-- 管理控制台端口(9090/http,9091/https) --> <port>9090</port> <securePort>9091</securePort> <interface>0.0.0.0</interface> <!-- 允许所有IP访问控制台 --> </adminConsole> <locale>zh_CN</locale> <!-- 语言设置为中文 --> <!-- 网络绑定配置(默认绑定所有网卡,无需修改) --> <!-- <network> <interface></interface> </network> --> <!-- 一次性访问令牌(默认禁用,无需修改) --> <!-- <oneTimeAccessToken>secretToken</oneTimeAccessToken> --> <connectionProvider> <className>org.jivesoftware.database.DefaultConnectionProvider</className> </connectionProvider> <!-- 数据库配置(保持你的原有配置,已验证正确) --> <database> <defaultProvider> <driver>com.mysql.cj.jdbc.Driver</driver> <serverURL>jdbc:mysql://localhost:3306/openfire?rewriteBatchedStatements=true&characterEncoding=UTF-8&characterSetResults=UTF-8&serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true</serverURL> <username encrypted="true">2bd71c7131f570a1ac7b6003d21e7e47e5fda4602de86b7db1076a5ef1f8d5ce</username> <password encrypted="true">3f3ae7ebe13aa1f16502c278f12cd80b25953d3995cfc8158b0283e908edf0a0e28f8c79ba84d40fd0562f79feb9b378</password> <testSQL>select 1</testSQL> <testBeforeUse>false</testBeforeUse> <testAfterUse>false</testAfterUse> <testTimeout>PT0.5S</testTimeout> <timeBetweenEvictionRuns>PT30S</timeBetweenEvictionRuns> <minIdleTime>PT15M</minIdleTime> <maxWaitTime>PT0.5S</maxWaitTime> <minConnections>5</minConnections> <maxConnections>25</maxConnections> <connectionTimeout>1.0</connectionTimeout> </defaultProvider> </database> <setup>true</setup> <!-- 已完成初始化设置 --> <fqdn>szrengjing.com</fqdn> <!-- 服务器域名 --> <clustering> <enabled>true</enabled> </clustering> </jive>
最新发布
11-17
# 删除旧文件 rm /www/wwwroot/szrengjing.com/admin/credit_log.php # 创建新文件 cat > /www/wwwroot/szrengjing.com/admin/credit_log.php << 'EOF' <?php define('IN_ECS', true); require_once('../includes/init.php'); admin_priv('users_manage'); // 获取参数 $user_id = !empty($_GET['user_id']) ? intval($_GET['user_id']) : 0; $start_date = !empty($_GET['start_date']) ? $_GET['start_date'] : date('Y-m-01'); $end_date = !empty($_GET['end_date']) ? $_GET['end_date'] : date('Y-m-d'); // 查询日志 $sql = "SELECT l.*, u.user_name AS username FROM ecs_user_credit_log l LEFT JOIN ecs_users u ON l.user_id = u.user_id WHERE 1=1"; if ($user_id) { $sql .= " AND l.user_id = '$user_id'"; } if ($start_date) { $sql .= " AND l.created_at >= '" . $start_date . " 00:00:00'"; } if ($end_date) { $sql .= " AND l.created_at <= '" . $end_date . " 23:59:59'"; } $sql .= " ORDER BY l.created_at DESC LIMIT 100"; $res = $db->query($sql); $logs = array(); while ($row = $db->fetchRow($res)) { $logs[] = $row; } ?> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8" /> <title>📊 用户信用变更日志</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" /> </head> <body class="p-4"> <h2 class="mb-4">🔐 用户信用变更日志</h2> <!-- 搜索表单 --> <form method="get" class="mb-4 bg-light p-3 rounded"> <div class="row g-3"> <div class="col-md-3"> <label><strong>用户ID:</strong></label> <input type="number" name="user_id" class="form-control" value="<?= htmlspecialchars($user_id) ?>" placeholder="请输入用户ID" /> </div> <div class="col-md-3"> <label><strong>起始日期:</strong></label> <input type="date" name="start_date" class="form-control" value="<?= $start_date ?>" /> </div> <div class="col-md-3"> <label><strong>结束日期:</strong></label> <input type="date" name="end_date" class="form-control" value="<?= $end_date ?>" /> </div> <div class="col-md-3 d-flex align-items-end"> <button type="submit" class="btn btn-primary w-100">🔍 查询</button> </div> </div> </form> <!-- 数据表格 --> <table class="table table-striped table-hover"> <thead class="table-light"> <tr> <th>ID</th> <th>用户ID</th> <th>用户名</th> <th>旧分值</th> <th>新分值</th> <th>变化值</th> <th>原因</th> <th>操作时间</th> </tr> </thead> <tbody> <?php if (empty($logs)): ?> <tr> <td colspan="8" class="text-muted text-center">🔍 没有找到符合条件的记录。</td> </tr> <?php else: ?> <?php foreach ($logs as $log): ?> <tr> <td><?= $log['id'] ?></td> <td><?= $log['user_id'] ?></td> <td><?= htmlspecialchars($log['username'] ?? '未知') ?></td> <td><?= $log['old_score'] ?></td> <td><?= $log['new_score'] ?></td> <td class="<?= $log['change_value'] > 0 ? 'text-success' : ($log['change_value'] < 0 ? 'text-danger' : '') ?>"> <?= $log['change_value'] ?> </td> <td title="<?= htmlspecialchars($log['reason']) ?>"> <?= strlen($log['reason']) > 50 ? substr(htmlspecialchars($log['reason']), 0, 50).'...' : htmlspecialchars($log['reason']) ?> </td> <td><?= $log['created_at'] ?></td> </tr> <?php endforeach; ?> <?php endif; ?> </tbody> </table> </body> </html> EOF 打不开
11-10
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值