gpt4 book ai didi

php - 为什么Apache2(Ubuntu)与Apache(Window上的easyPHP服务器)运行不同?

转载 作者:行者123 更新时间:2023-12-04 19:22:56 24 4
gpt4 key购买 nike

我有一个草稿课:(更新)

class abb{
static $fieldSelect;
function init() {
self::$field = require_once('inputs/Mapping.php');
}
function getField($item) {
return self::$fieldSelect[$item];
}
}

Mapping.php包含:
<?php
return array(
ItemType::Food => 0.7,
ItemType::Fashion => 0.5,
);

它在easyPHP(windows 7)上运行良好,但是当我将它部署到Apache2(Unbutu)上时,出现错误异常。比如我输入 $item = "Phone" (在此处更新),Apache2 抛出异常: Undefined index: Phone在行 return self::$fieldSelect[$item];如果 $fieldSelect[$item]不存在,Window 上的服务器将返回 NULL但 Ubuntu 不是。我只是想在运行它时看到 Window 和 Ubuntu 之间的不同。

我不明白为什么会这样?

最佳答案

我假设 error reporting level在不同的系统上进行了不同的配置。

关于php - 为什么Apache2(Ubuntu)与Apache(Window上的easyPHP服务器)运行不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9715368/

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