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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:00:23+00:00 2026-05-15T19:00:23+00:00

Hai. I’ve got site which is really weird, and now is making me troubles.

  • 0

Hai.
I’ve got site which is really weird, and now is making me troubles.
This is simplified structure

public_html
- adm
--- raport
------ raportpdf.php
--- class
------ Bonus
--------- Bonus_DAO.class.php 
------ config.php
--- raport.php
- index.php

So. Index.php is giant loader. It has lines: (but I don’t think that they are making diffrence)

set_include_path('lib/DB' . PATH_SEPARATOR . get_include_path());
set_include_path('lib/PHPLOT' . PATH_SEPARATOR . get_include_path());
set_include_path('config' . PATH_SEPARATOR . get_include_path());
set_include_path('view' . PATH_SEPARATOR . get_include_path());
set_include_path('controller' . PATH_SEPARATOR . get_include_path());
set_include_path('model' . PATH_SEPARATOR . get_include_path());

Inside Bonus_DAO.class.php is something like

require_once('./adm/class/config.php');

Raportpdf.php is called through index.php – it sends it’s content without any error at mail.
But when I want to access raport.php, I have error like:

Warning: require_once(./adm/class/config.php) [function.require-once]: failed to open stream: No such file or directory in /home/panele/domains/blahblah/public_html/adm/class/Bonus/Bonus_DAO.class.php  on line 2

Fatal error: require_once() [function.require]: Failed opening required './adm/class/config.php' (include_path='.:/usr/local/lib/php') in /home/panele/domains/blahblah/public_html/adm/class/Bonus/Bonus_DAO.class.php on line 2

How can I solve this?

  • 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-15T19:00:24+00:00Added an answer on May 15, 2026 at 7:00 pm

    Insert a line such as the following into a file which is included in this structure of yours (this included file MUST be located in your root directory, something like a config.php or I usually use init.php).

    define("ROOT_DIR",dirname(__FILE__));
    

    Then, where you are receiving the errors (or for synonymy within your code for that matter – anywhere you require()/include()), add ROOT_DIR.”/path/to/file” before it. What this is doing is giving the absolute path to the root directory and then you simply specify the directory within the root which you are looking for. For sake of example, my root directory is “/home2/example.” Now, I insert this line in a file which I have included, etc. and change the require line to this:

    require_once(ROOT_DIR."/adm/class/config.php");
    

    The line above basically translates out to this (assuming that I used the define(); statement within a file located in /home2/example)

    require_once("/home2/example/adm/class/config.php");
    

    So basically, this is an easy way to give static paths a dynamic element so you won’t run into this problem again!

    Good luck!
    Dennis M.

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

Sidebar

Related Questions

Hai I am having a form which contains a filetype like this <tr><td> <input
hai I have a Spanish site in php. In this a mail body contain
Hai Techies, I have some stored procedure which was written in SQL server.Now i
I have used this in my HTML: <q> Hai How r u </q> Which
Hai I have an application which is designed in netbeans6.0.1 where i need to
Hai I have developed a standalone application in which when an user logs in,
Hai every one I am developing an windows application in which i have to
Hai I want to do an e-commerce site in magento. Here I want to
Hai presently i have grid like this. <Grid Name=tGrid1 Grid.Row=0 Background=Black > </Grid> <Grid
Hai I am developing a standalone application using Java in which I am using

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.