【问题标题】:After migrating a website with MYSQL DB the website (PHP) displays an error. what does the error mean?使用 MYSQL DB 迁移网站后,网站 (PHP) 显示错误。错误是什么意思?
【发布时间】:2013-08-15 13:12:38
【问题描述】:

我对一切还是很陌生。因此,如果您需要更多信息,请告诉我。

到目前为止我做了什么:

我将一个网站从一台 ubuntu 10.10 服务器复制到另一台 12.04 ubuntu 服务器。 我还备份和恢复了 MYSQL 数据库。 我配置了 apache2(现在只是在本地)来显示我的页面。 我在 3 个端口上有 3 个页面,其他页面工作,所以我可能正确配置了 apache2。 起初我只是看到一个空白页面,当我试图联系我的网站时,我打开了错误屏幕。

这是出现的内容,我将网站名称替换为 xxxx:

 Deprecated: Function set_magic_quotes_runtime() is deprecated in /data/xxxx/www/index.php on line 11
 Deprecated: Assigning the return value of new by reference is deprecated in /data/xxxx/www/pear/DB.php 
 on line 311 Deprecated: Assigning the return value of new by reference is deprecated in /data/xxxx/www/pear/DB.php 
 on line 385 Deprecated: Assigning the return value of new by reference is deprecated in /data/xxxx/www/pear/DB.php
  on line 923 Deprecated: Assigning the return value of new by reference is deprecated in /data/xxxx/www/pear/HTML/AJAX/Server.php
   on line 161 Deprecated: Assigning the return value of new by reference is deprecated in /data/xxxx/www/pear/HTML/AJAX.php
    on line 612 Deprecated: Assigning the return value of new by reference is deprecated in /data/xxxx/www/pear/HTML/AJAX/Serializer/JSON.php 
    on line 46 Warning: include_once(../pear/Net/Socket.php): failed to open stream: No such file or directory in /data/xxxx/www/pear/Net/SMTP.php 
    on line 25 Warning: include_once(): Failed opening '../pear/Net/Socket.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear')
    in /data/xxxx/www/pear/Net/SMTP.php on line 25 Warning: include_once(PEAR.php): failed to open stream: No such file or directory in
     /data/xxxx/www/pear/Mail/mime.php on line 65 Warning: include_once(): Failed opening 'PEAR.php' for inclusion
      (include_path='.:/usr/share/php:/usr/share/pear') in /data/xxxx/www/pear/Mail/mime.php on line 65 Warning:
       include_once(../pear/Mail/mimePart.php): failed to open stream: No such file or directory in /data/xxxx/www/pear/Mail/mime.php 
       on line 75 Warning: include_once(): Failed opening '../pear/Mail/mimePart.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear')
        in /data/xxxx/www/pear/Mail/mime.php on line 75 Deprecated: Assigning the return value of new by reference is deprecated in 
        /data/xxxx/www/pear/Spreadsheet/Excel/Writer/Workbook.php on line 180 Deprecated: Assigning the return value of new by reference 
        is deprecated in /data/xxxx/www/pear/Spreadsheet/Excel/Writer/Workbook.php on line 189 Deprecated: Call-time pass-by-reference
         has been deprecated in /data/xxxx/www/modules/statistics/frontend.class.php on line 16 Deprecated: Call-time pass-by-reference 
         has been deprecated in /data/xxxx/www/modules/users/frontend.class.php on line 19 Deprecated: Assigning the return value of new 
         by reference is deprecated in /data/xxxx/www/pear/DB/common.php on line 958 Deprecated: Assigning the return value of new by
          reference is deprecated in /data/xxxx/www/pear/DB/common.php on line 1150 Notice: DB Error: connect failed in 
          /data/xxxx/www/classes/registry.class.php on line 70 

我在这里唯一理解的是:简单邮件传输协议 (SMTP)

似乎有些数据没有正确复制。 如何检查文件夹和子文件夹的 excat 大小?所以我至少可以比较:) 提前致谢。

任何帮助都会很快被投票。

【问题讨论】:

  • 老兄,您现在在更新版本的 php 上运行,您的许多旧功能现已弃用。以及您还缺少对某些文件的引用。
  • 正如错误消息所说,您的代码已过时。你需要找到每个错误(你被告知它们的确切位置)并纠正它们。谷歌错误信息,你会被告知确切地如何修复它们。
  • 您还可以查看已弃用的功能页面,该页面还会告诉您要移出到什么地方
  • Error: connect failed in /data/xxxx/www/classes/registry.class.php on line 70: 可能是一个好的开始?
  • 除了保持代码更新之外,没有聪明的解决方案

标签: php error-handling web syntax-error


【解决方案1】:

set_magic_quotes_runtime()

只要摆脱这个函数调用。

通过引用分配new的返回值在

中被弃用了

只需删除并在声明中签名即可。

警告:include_once(PEAR.php):

你必须安装 PEAR

【讨论】:

    【解决方案2】:

    您似乎更改了 PHP 版本。很可能您的 Ubuntu 10.10 盒子正在运行 PHP 5.2.xPHP 5.3.x,而现在您的 Ubuntu 12.04 盒子正在运行 PHP 5.4.xPHP 5.5.x(几率很小)。

    你有两个真正的解决方案:

    更新您的代码(推荐)

    逐行更新代码并纠正错误,您应该能够单独研究这些错误并将http://php.net/用作资源。

    降级您的 php/mysql 版本

    您可以通过在终端中运行以下命令来检查 Ubuntu 10.10 上的旧 PHP 版本:php -v;然后在你的 12.04 机器上执行相同的命令,看看你升级到了什么。

    有很多文档可以在 Linux 上更改 PHP 版本,因此我授权您进行研究。

    您还需要将您的 php.ini 配置复制到新安装 - 从您的 magic_quotes 错误的外观来看,您很可能有一些古老的配置。

    【讨论】:

    • 我刚刚检查了我的版本。 12.04 有 5.3.10 和旧服务器 10.10 ubuntu 有: 5.3.3 你建议我做什么?解决所有问题或尝试让旧版本的 php 在新服务器上运行?
    • @RayofCommand 嗯...这不是重大的版本更改。我会比较你的 php.ini 文件。让我想知道您是否一直以来都关闭了严格的错误通知以及其他一些古老的配置。
    • 这是我在添加 display_errors 之前在 index.php 中发现的错误报告; : error_reporting(E_ERROR | E_PARSE /*| E_WARNING*/); error_reporting(E_ALL);
    • 我把旧的ini文件复制到新的服务器上,还是一样。
    • @RayofCommand 所有deprecated 错误都只是警告,功能仍然存在。像:Warning: include_once(../pear/Net/Socket.php): failed to open stream: No such file or directory in /data/xxxx/www/pear/Net/SMTP.php 这样的错误意味着您丢失的文件——它们很可能在您的服务器路径中。您可以简单地禁用 E_STRICT ^ E_WARNING 错误报告以关闭弃用通知。
    猜你喜欢
    • 2017-02-03
    • 1970-01-01
    • 2017-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-10
    • 2020-11-04
    • 1970-01-01
    相关资源
    最近更新 更多