gpt4 book ai didi

php - 新的 Laravel 安装 v 5.4 index.php 抛出解析错误。 PHP 7.2.10-0ubuntu0.18.04.1

转载 作者:可可西里 更新时间:2023-11-01 00:39:07 25 4
gpt4 key购买 nike

<分区>

在 Digital Ocean、Ubuntu 上安装新的 Laravel。当前 PhP 安装。 Apache2 可以正常访问 Php,因为我添加了几行代码来吐出错误。这是输出:

解析错误:语法错误,/var/www/html/blog/vendor/laravel/framework/src/Illuminate/Support/Arr.php 第 388 行出现意外的 '='

    public static function pluck($array, $value, $key = null)
{
$results = [];
[$value, $key] = static::explodePluckParameters($value, $key);
foreach ($array as $item) {
$itemValue = data_get($item, $value);
// If the key is "null", we will just append the value to the array and keep
// looping. Otherwise we will key the array using the value of the key we
// received from the developer. Then we'll return the final array form.
if (is_null($key)) {
$results[] = $itemValue;
} else {
$itemKey = data_get($item, $key);
if (is_object($itemKey) && method_exists($itemKey, '__toString')) {
$itemKey = (string) $itemKey;
}
$results[$itemKey] = $itemValue;
}
}
return $results;
}

第 888 行是:

[$value, $key] = static::explodePluckParameters($value, $key);

Laravel 在使用“laravel new(站点名称)”创建新站点时会自动创建一个 key

服务器正常运行我的其他站点。我已经完成了几次干净的 Laravel 安装,同样的问题。

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