TomatoCart-v1.1.8.2部署时报错

本文针对PHP5.4及以上版本中遇到的与MySQL连接相关的问题进行了详细解析,并提供了解决方案,主要是通过调整PHP错误报告级别来规避废弃的MySQL连接方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、异常信息
Strict Standards: Non-static method osC_Database::connect() should not be called statically in C:\xampp\htdocs\TomatoCart\install\templates\pages\step_6.php on line 16

Strict Standards: Declaration of osC_Database_mysql::connect() should be compatible with & osC_Database::connect($server, $username, $password, $type = 'DB_DATABAS...') in C:\xampp\htdocs\TomatoCart\includes\classes\database\mysql.php on line 311

这是由于php版本引起的,php5.4.5高版本中mysql::connect()已经废除此方法。

二、 解决办法

Please find the following code in the install/includes/application.php:

  if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
    error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
  } else {
    error_reporting(E_ALL & ~E_NOTICE);
  }

替换为

  if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
    error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT);
  } else {
    error_reporting(E_ALL & ~E_NOTICE);
  }



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值