gpt4 book ai didi

php - 加载主页后在UserFrosting上的php错误日志

转载 作者:行者123 更新时间:2023-12-03 07:49:44 27 4
gpt4 key购买 nike

我正在尝试安装UserFrosting
加载主页后出现这些错误

[01-Oct-2016 18:28:29 Asia/Jerusalem] PHP 6. Composer\Autoload\includeFile() C:\Server\userfrosting\vendor\composer\ClassLoader.php:301
[01-Oct-2016 18:28:29 Asia/Jerusalem] PHP 5. Composer\Autoload\ClassLoader->loadClass() C:\Server\userfrosting\initialize.php:25
[01-Oct-2016 18:28:29 Asia/Jerusalem] PHP 4. spl_autoload_call() C:\Server\userfrosting\initialize.php:25
[01-Oct-2016 18:28:29 Asia/Jerusalem] PHP 3. UserFrosting\UserFrosting->setupGuestEnvironment() C:\Server\userfrosting\initialize.php:193
[01-Oct-2016 18:28:29 Asia/Jerusalem] PHP 2. require_once() C:\Server\index.php:10
[01-Oct-2016 18:28:29 Asia/Jerusalem] PHP 1. {main}() C:\Server\index.php:0
[01-Oct-2016 18:28:29 Asia/Jerusalem] PHP Stack trace:
[01-Oct-2016 18:28:29 Asia/Jerusalem] PHP Strict standards: Declaration of UserFrosting\User::fresh() should be compatible with Illuminate\Database\Eloquent\Model::fresh(array $with = Array) in C:\Server\userfrosting\models\database\User.php on line 570

而且我找不到问题
谢谢你的帮助

最佳答案

错误PHP Strict standards: Declaration of UserFrosting\User::fresh() should be compatible with Illuminate\Database\Eloquent\Model::fresh(array $with = Array) in C:\Server\userfrosting\models\database\User.php on line 570意味着UserFrosting\User::fresh()方法应接受与Illuminate\Database\Eloquent\Model::fresh(array $with = Array)相同类型的参数。

可以使用以下代码来重现该问题:

test.php

<?php
class A {
public function test ($arg = 'default value') {
echo $arg;
}
}

class B extends A {
public function test () {
echo __METHOD__;
}
}

$b = new B;
$b->test();

运行脚本:
$ php test.php
PHP Warning: Declaration of B::test() should be compatible with A::test($arg = 'default va...') in /home/ruslan/tmp/src/test.php on line 12

为了解决这个问题,我们应该根据父方法修改派生类中的 test方法:

class B extends A {
public function test ($arg = 'X value') {
echo __METHOD__;
}
}

运行脚本:
$ php test.php 
B::test

关于php - 加载主页后在UserFrosting上的php错误日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39808635/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com