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

  • Home
  • SEARCH
  • 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 7825923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:12:13+00:00 2026-06-02T09:12:13+00:00

this is my piece of php code: <?php require_once ‘php/Classes/User/UserDataBaseManager.php’; require_once ‘facebook/src/facebook.php’; ?> And

  • 0

this is my piece of php code:

<?php
require_once 'php/Classes/User/UserDataBaseManager.php';
require_once 'facebook/src/facebook.php';
?>

And when I try to browse this code in http:/mydomain/myfile.php then the browser return an error 500.

Apache log says:

[Wed Apr 18 20:38:07 2012] [error] [client 190.50.81.189] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'php/classes/DataBase/DataBaseManager.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/virtuales/blyxo.com/php/Classes/User/UserDataBaseManager.php

Solutions?

  • 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-02T09:12:15+00:00Added an answer on June 2, 2026 at 9:12 am

    What this looks like to me is that the file UserDatabaseManager.php is trying to include DataBaseManager.php but it is providing the wrong path. Your apache error indicates that it will first look in . i.e. the current directory then /usr/share/pear then /usr/share/php

    Your DataBasemanger.php file is not in either of the last two. When it attempts to look in the current directory it is including your relative path. So when your UserDataBaseManager.php file (which is in php/Classes/User/) provides that path then apache ends up looking for your DataBaseManager.php file in php/Classes/User/php/classes/DataBase/DataBaseManager.php

    There are several ways to approach this. You could get the document root and prepend it to every include like this

    $root = $_SERVER['DOCUMENT_ROOT'];
    require_once($root . "/php/classes/DataBase/DataBaseManager.php");
    

    Or if this app is in a controlled environment and you can edit the php.ini file you can define the include path to also look in /var/www/virtuales/blyxo.com/php/Classes/ and just include the file with

    require_once("Database/DataBaseManager.php");
    

    A better solution might be to define an __autoload function that will be called every time you try to instantiate a new object and have it use some logic to look for the file to include. This solution would take a bit more restructuring but you might consider it. Here is the doc on defining your own auto loader https://www.php.net/manual/en/function.autoload.php

    I know there are other ways to do this. Let me know what works for you!

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

Sidebar

Related Questions

I have this piece of php - mysql code: When a user tagged in
I currently have this piece of code: NSString *strURL = [NSString stringWithFormat:@http://www.sample.com /phpFile.php?firstname=%@,txtfirstName.text]; NSString
I have this piece of code: <?php $pattern = /<span\b[^>]*>(.*?)</; $html = file_get_contents(http://www.bicicletapublica.com.ar/mapa.aspx); $results
I'm trying to get this piece of code working: <?php $color_animation = $_GET['color_animation']; if
I'm having this problem with this piece of PHP code: class Core { public
I'm trying to convert this piece of code from PHP to C#. It's part
I have this piece of PHP code: <?php $username=$_POST['username']; $password=$_POST['password']; if($username&&$password){ $connect=mysql_connect(localhost,root,) or die(
I noticed this piece of code in Wordpress 2.9.1 (/wp-includes/compat.php), I don't understand it:
I have this piece of code in my cms: <ul class=subsection_tabs id=tab_group_one style=clear:none;> <?php
I made this piece of php code which grabs a RSS feed, but I'm

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.