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 8598383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:08:18+00:00 2026-06-12T01:08:18+00:00

I am having some problems using require or require_once in that the code halts

  • 0

I am having some problems using require or require_once in that the code halts execution after the call and I am struggling to find what exactly is causing the problem.

I have checked the file exists and can be read (via file_exists and is_readable) but both of these appear to be true so I am a little stumped.

require_once('file1.php');
print('a');
$file = 'file2.php';
if (!file_exists($file)) { die('file does not exist'); }
if (!is_readable($file)) { die('cannot read file'); }
require_once($file);
print('b');

Above code outputs only ‘a’ and nothing after.

Another file on the server uses both of the files in question in the same way without problem.

Is there anything else I could check?

Any help would be appreciated.

Edit:

Setting error_reporting(E_ALL) does not change the output.

Changing the file path to a blank file in the same directory changes the output to ‘ab’, indiciating the require has worked and suggesting their is a problem with file2.php, however another file on the server successfully uses these file in the exact same manner.

Running php -l for file2.php returns no errors.

Commenting out the first require makes no difference.

Edit2:

Problem was to do with a call to class_exists and the change in behaviour in version 5.0 to do with auto loading. The code in question was wrote before upgrade to 5.0.

  • 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-06-12T01:08:19+00:00Added an answer on June 12, 2026 at 1:08 am

    Set error_reporting(E_ALL) and try to include an empty file instead of file2.php.

    Maybe file2.php has some bug that halts the flow

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

Sidebar

Related Questions

I am having some problems with the PDF files that I make using the
I'm having some problems using cascade operations on hibernate. I have one entity (TripleDBmodel),
I'm having some problems while using PDO. It all seems correct but I am
I am having some problems parsing this piece of XML using SimpleXML. There is
I'm having some problems with users cheating my online game by using macros to
I am using the jQuery UI components but having some problems. If I try
I'm using the LUA middleclass library now after some problems and I have a
I'm having problems with macOSX and virtualenv. It seems to ignore --no-site-package. Using exactly
I'm having some problems using Sinatra with Capybara. I want to test a pure
I am having problems loading some of the semantic packages that Alex Ott recommends

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.