Composer自动加载致命错误:找不到类

似乎在我的composer json文件配置或我的php代码中存在问题。但是我得到这个错误。

  

严重错误:未捕获的错误:找不到类'Inc \ System \ Debug'   在/var/www/html/used-guitars/rss6.xml.php:28

Machine Name | Service Tag
Laptop01     | 
Laptop02     |

这是我的composer.json文件的内容,放置在“ used-guitars”文件夹中。我当然已经完成了作曲家的转储自动加载。

Private Sub btn_WScript_CMD_Click()
    CreateObject("WScript.Shell").Run "CMD.EXE /k wmic /node:Laptop01 bios get serialnumber"
End Sub

这是我的Debug.php

used-guitars
--- inc
     ---System
          ---Debug.php

在我的php文件中,我必须在其中调用我使用的类:

{
    "name": "oslt/used-guitars-rss","description": "RSS feeds for used guitars","type": "project","license": "GPL","authors": [
        {
            "name": "bernhard Lierheimer","email": "blierheimer@online.de"
        }
    ],"minimum-stability": "dev","require": {
        "dts/ebay-sdk-php": "^18.0"
    },"autoload": {
    "psr-4": {
        "Inc\\": "./inc"
        }
    }
}

发生了什么事?非常感谢你!

coo1cool798 回答:Composer自动加载致命错误:找不到类

解决了,只是我确实忘记了脚本的开头!

/** Composer Autoload to define Namespaces */
if ( file_exists(dirname(__FILE__).'/vendor/autoload.php') ) {
    require_once dirname(__FILE__).'/vendor/autoload.php';
}
本文链接:https://www.f2er.com/3116362.html

大家都在问