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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:07:24+00:00 2026-05-13T00:07:24+00:00

I’m new to doctrine. I created an bootstrap file like the following one: require_once(dirname(__FILE__)./../conf/general.php);

  • 0

I’m new to doctrine. I created an bootstrap file like the following one:

require_once(dirname(__FILE__)."/../conf/general.php");
require_once(dirname(__FILE__).'/Doctrine/lib/Doctrine.php');
spl_autoload_register(array('Doctrine', 'autoload'));

$manager = Doctrine_Manager::getInstance();
$manager->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_ALL); 
$manager->setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true); #for accessor  overriding
$manager->setAttribute(Doctrine_Core::ATTR_AUTOLOAD_TABLE_CLASSES, true); #in order to be able to use the XTable classes
$manager->setAttribute(Doctrine_Core::ATTR_MODEL_LOADING,    Doctrine_Core::MODEL_LOADING_CONSERVATIVE); #to conservatively load files
$manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_ALL); 

$dsn = "mysql:dbname=".DBNAME.";host=".DBHOST;
$dbh = new PDO( $dsn, DBUSERNAME, DBPASS );
$conn = Doctrine_Manager::connection( $dbh ); 
Doctrine_Core::loadModels('doc_models'); #In order to be able to work with models

php bootstrap.php

command works just as expected.
But I have a file X.php under directory Y and i require bootstrap.php file in X.php ;but when i ran the X.php in the directory Y like

 php X.php

I got the following exception:

Doctrine_Exception: You must pass a valid path to a directory containing Doctrine models in /path_to_directory_of_bootstrap_file/Doctrine/lib/Doctrine/Core.php on line 635

Now, how can i fix this issue?

BTW, when i put X.php and bootstrap.php in the same directory it works as expected.
I also tried to require with absolute paths but this didn’t solve my problem. I’m testing on Ubuntu 9.10 and installed doctrine from pear. Doctrine version is 1.2.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-05-13T00:07:24+00:00Added an answer on May 13, 2026 at 12:07 am

    Did you try using absolute paths while requiring? Realpath can help you create those paths.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to count the length of a string with PHP. The string
I want use html5's new tag to play a wav file (currently only supported
I am trying to render a haml file in a javascript response like so:
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.