Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7167935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:40:40+00:00 2026-05-28T14:40:40+00:00

I moved a file in our system to a sub folder for organization, which

  • 0

I moved a file in our system to a sub folder for organization, which in turn broke a require statement’s relative path. This should have resulted in a E_COMPILE_ERROR warning. However, instead of that error, our custom error handler in the application caught the error as a E_WARNING. So, our customer handler logged the message and the resulting PHP Screen came up empty, as if die(); was run. Here is the log created by our local handler:

E_WARNING main(XXXXXX.php): failed to open stream: No such file or directory xxx/xxx.php Line 9 01-26-2012 09:44:27 AM 01-26-2012 10:03:24 AM

It may be important to note that our system is still using poor old PHP 4.

Any idea why require would throw an E_WARNING? This took a bit longer to figure out what the issue was, since we couldn’t see any error message.


Edit: The application was definitely doing a require. The custom error handler is simply using PHP’s set_error_handler function. So it shouldn’t be called for anything other than warnings, notices, and user errors.


Additional Edit:

Maybe the structure has something to do with this? Here’s how its working:
(-> means includes, => means requires)

main->File1.php=>File2.php

Does it throw a warning because File1.php is included, but not required? This might make sense to me, but would appear to be a glitch? I might need to test this on PHP 5.


RESOLUTION

I’ve scanned through our application and found this:

error_reporting(E_ERROR | E_WARNING | E_PARSE);

Therefore, E_COMPILE_ERROR will not show up. Furthermore, @DaveRandom is correct about it throwing a warning, then throwing a fatal error.

Changing it to
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR);
shows the error message.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:40:41+00:00Added an answer on May 28, 2026 at 2:40 pm

    Require emits this warning at least once when you call it on a file that does not exist. It then emits an E_COMPILE_ERROR and dies.

    However:

    The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called.

    So your custom error handler will never catch the error I’m afraid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now, I'm using this to allow a file to be moved to our
I keep getting this error, although the file still gets moved into the correct
The file system part of our asp.net application framework requires updating to fall inline
This is a little related to my previous question Solaris: Mounting a file system
We've been seeing this error crop up in our system event logs an alarming
So somebody on our team moved an entire folder into a subdirectory without using
We use absolut path or relatvie path to find a file in our C#
I've moved a file manually and then I've modified it. According to Git, it
The facts: When a file is moved, there's two possibilities: The source and destination
Is there a way to tell when a file was moved to a certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.