Why do HTTP500 errors occur with Spl_autoload_register?

Source: Internet
Author: User
Tags autoload spl objet
I am a student in the school, PHP has just finished learning the object-oriented part, is currently understanding the use of SPL library, found that some of the SPL is not a good understanding of the project root directory is as follows ... Also hope that the gods are pointing twos

PSR-0
├──app
│└──controller
│└──home
│└──revamp.php
├──users
│├──loader.php
│└──object.php
└──index.php

The load classes are as follows loader.php


  
   

Revamp.php

 

入口文件如下index.php:

 

第二个 Revamp类的加载为何会一直有问题?出现HTTP500错误

Reply content:

I am a student in the school, PHP has just finished learning the object-oriented part, is currently understanding the use of SPL library, found that some of the SPL is not a good understanding of the project root directory is as follows ... Also hope that the gods are pointing twos

PSR-0
├──app
│└──controller
│└──home
│└──revamp.php
├──users
│├──loader.php
│└──object.php
└──index.php

The load classes are as follows loader.php


  
      

Revamp.php

 

入口文件如下index.php:

 

第二个 Revamp类的加载为何会一直有问题?出现HTTP500错误

打开错误显示,看看具体的错误是什么。估计你这个情况和 ClassName 的处理有关,注意类名前面还有一个斜杠的

看你发的目录结构,Controller和Home放在同一级了

我按照你的代码敲了一遍,没做任何改变,可以正常输出~

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.