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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:03:43+00:00 2026-05-31T17:03:43+00:00

My defs.php has a define that I need, and although I used require_once for

  • 0

My defs.php has a define that I need, and although I used require_once for it, when I try to access defs.php, I get a series of duplicates as if the defs.php was already called before.
On the other hand, if I don’t call it, I get undefined use of undefined constant…

Any ideas?

Thanks!

  • 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-31T17:03:44+00:00Added an answer on May 31, 2026 at 5:03 pm

    Probably you’re using 2 separate paths to the file. I’ve seen this issues when doing:

    require_once("somefile.php");
    require_once("/full/path/to/somefile.php");
    

    I think php keep track of what’s been included in a way that doesn’t intelligently assess all possible path combinations to the same file and treat it as the same.

    I try to avoid using requires and includes by wrapping everything in object and using an autoloader. For constants, I make an object with a bunch of static properties.

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

Sidebar

Related Questions

I have a tiles-defs.xml that has these definitions... <definition name=masterLayout path=/WEB-INF/tiles-layouts/globalLayout.jsp> <put name=pageTemplate value=over-ride
Xcode has these handy time savers in the scripts menu called Code->Place Accessor Defs
I'm having a problem with $.get that I've never had before, and can't seem
I'm trying to get smooth audio playback for an app that needs to play
I'm looking for Ruby's Active record for PHP. Something that is so simple that
I need to get an attribute from svg file on classic asp. But my
I find the defs circular, the subjects are defined by their verbs but the
If you compile a shared library with GCC and pass the -z defs flag
I am getting the user preferred language from the below code: NSUserDefaults* defs =
Right now I am trying to use selenium ide to write code that makes

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.