Re: help with configuring DB_DataObject
| From: | Wesley Furgiuele | Date: | Sun, 11 Sep 2005 20:18:03 +0000 |
| Subject: | Re: help with configuring DB_DataObject | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20904@lists.php.net to get a copy of this message | ||
Justin:
Thanks for the suggestions. The output of a web-based phpinfo() result and php -i at the command line produce the same local and master include paths. I reviewed the PHP.ini file though and made sure to turn on register_argc_argv, which it wasn't, but this made no difference. From reviewing my other settings, I don't see any that I think impact the way this should function.
Before I give up on this, can I just ask you -- am I missing a step somewhere? I created the .ini file, put it in a subdirectory of my web root (I put it in the same directory that I set as the class location). Then I tried running the createTables.php file with a command like: php createTables.php /path/to/.ini_file and I get the error messages about not being able to find DB. I get this error message regardless of the directory I am in when I run the createTables.php file (I tried it from the DataObject directory, from the main PEAR directory, and from the directory in which the .ini file resides).
I can turn right around and, at the command line, run any of my other scripts -- one that generates some reports from a database, for example -- with no problem, knowing the utilize DB.
Thanks again for your advice.
Wes
On Sep 11, 2005, at 3:25 PM, Justin Patrin wrote:
On 9/11/05, Wesley Furgiuele <wesley@furgiuele.net> wrote:Thanks for your response. I did indeed use PEAR to install these files. I have quite a few PEAR packages installed with no problems. All the PEAR files are installed as the same user/group with the same permissions (755 on directories, 744 on files). I am trying to implement DB_DataObject into a currently existing application that is already utilizing PEAR's DB package, as well as several other packages with no errors or warnings being generated. When I run phpinfo(), my include path is listed as ".:/usr/local/php5/ lib/php", which is the default. I can try to substitute into Generator.php the full path of DB.php, but I don't understand why that's necessary if PHP is telling me that the include path points to the PEAR directory. Without any familiarity with this one, I'm not sure what kind of results I would get if I move forward like that.Your problem is likely that the include_path is set up for web, but not for command-line. Check the output of phpinfo(); when using php on the command-line and check tis php.ini. It's probably different than the one you use for the web. Alternately you can use the generator from the web. Just load your ini file and loa dup the generator.Wes On Sep 11, 2005, at 3:06 PM, Justin Patrin wrote:--Justin PatrinOn 9/11/05, Wesley Furgiuele <wesley@furgiuele.net> wrote:-- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpI don't know if I'm missing something obvious, but I can't seem to get DB_DataObject configured. ------------CURRENT SETUP----------------- Mac OS X Server 10.4.2 PHP 5.0.4 (module from Marc Liyanage) MySQL 4.0.18 (Apple default installation) Apache 1.3.33 (Apple default installation) /Library/WebServer/Documents <-- web root .:/usr/local/php5/lib/php <-- include_path PEAR 1.3.5 stable DB_DataObject 1.7.15 stable DB 1.7.6 stable -----------------END SETUP---------------------- As I understand it, the steps are (1) create the .ini file (2) create the classes with the .ini file (3) before use, configure DB_DataObject with the .ini file I have several databases I want to access with DB_DataObject. So, here is my config file, saved at /Library/WebServer/Documents/ includes/DataObject/db_dataobject.ini: ----------------db_dataobject.ini------------------------ [DB_DataObject] database_first = mysql//root_username:root_password@localhost/first database_second = mysql//root_username:root_password@localhost/second database_the_third = mysql//root_username:root_password@localhost/ the_third schema_location = /Library/WebServer/Documents/includes/DataObject/ class_location = /Library/WebServer/Documents/includes/DataObject/ require_prefix = /Library/WebServer/Documents/includes/DataObject/ class_prefix = DataObject_ debug = 3 --------------------------------------------------------------- At this point, I change directories to the DataObject directory and try to create the classes, like so: grok: /Library/WebServer/Documents/includes/DataObject grok$ cd /usr/ local/php5/lib/php/DB/DataObject grok: /usr/local/php5/lib/php/DB/DataObject grok$ php createTables.php /Library/WebServer/Documents/includes/DataObject/ db_dataobject.iniSounds like you don' t have PEAR installed correctly or you didn't set up your include_path right. Did you use the PEAR installer to install these packages? -- Justin Patrin -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpDB_DataObject_Geneator : 0 : CREATING FOR firstPHP Fatal error: Class 'DB' not found in /usr/local/php5/lib/php/DB/ DataObject/Generator.php on line 112 Fatal Error: Class 'DB' not found in /usr/local/php5/lib/php/DB/ DataObject/Generator.php on line 112