[PHP] Requiring stuff question
I have the following in a config file: // Define and require the Smarty library define('SMARTY_DIR', 'Smarty/'); require(SMARTY_DIR . 'Smarty.class.php'); // Define the pager stuff define('PAGER_DIR', 'Pager/'); require(PAGER_DIR . 'Pager.php'); require(PAGER_DIR . 'Pager_Wrapper.php'); // Define the DB package define('PEAR_DB', 'DB/'); require(PEAR_DB . 'DB.php'); The Smarty stuff works no problem. The DB and Pager stuff do not. Since I am new to PHP I may be just misunderstanding how to do it. I am using Apache/PHP on Windows. Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Requiring stuff question
[snip] // Define and require the Smarty library define('SMARTY_DIR', 'Smarty/'); require(SMARTY_DIR . 'Smarty.class.php'); // Define the pager stuff define('PAGER_DIR', 'Pager/'); require(PAGER_DIR . 'Pager.php'); require(PAGER_DIR . 'Pager_Wrapper.php'); // Define the DB package define('PEAR_DB', 'DB/'); require(PEAR_DB . 'DB.php'); The Smarty stuff works no problem. The DB and Pager stuff do not. Since I am new to PHP I may be just misunderstanding how to do it. [/snip] What is the whole exact path to the DB and Pager stuff? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Requiring stuff question
Robert wrote: I have the following in a config file: // Define and require the Smarty library define('SMARTY_DIR', 'Smarty/'); require(SMARTY_DIR . 'Smarty.class.php'); // Define the pager stuff define('PAGER_DIR', 'Pager/'); require(PAGER_DIR . 'Pager.php'); require(PAGER_DIR . 'Pager_Wrapper.php'); // Define the DB package define('PEAR_DB', 'DB/'); require(PEAR_DB . 'DB.php'); The Smarty stuff works no problem. The DB and Pager stuff do not. Since I am new to PHP I may be just misunderstanding how to do it. What's the error you're getting? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Requiring stuff question
Robert wrote: I have the following in a config file: // Define and require the Smarty library define('SMARTY_DIR', 'Smarty/'); require(SMARTY_DIR . 'Smarty.class.php'); // Define the pager stuff define('PAGER_DIR', 'Pager/'); require(PAGER_DIR . 'Pager.php'); require(PAGER_DIR . 'Pager_Wrapper.php'); // Define the DB package define('PEAR_DB', 'DB/'); require(PEAR_DB . 'DB.php'); The Smarty stuff works no problem. The DB and Pager stuff do not. Since I am new to PHP I may be just misunderstanding how to do it. indeed you are - your require statements are ok but some of the files (with relative paths) are not found because your include_path does not include the base directory where your PEAR classes are found (I guess that the DB and Pager classes are PEAR things :-) either make sure include_path is set correctly, this can be done in the php.ini, in a .htacess file (Apache specific) or by using: // you have to decide what the value of $incPath should be! ini_set('include_path', $incPath); or you can change the define() statements in your config file so that they define the full path to the directories in question rather than a relative path e.g: define('PAGER_DIR', 'C:/Path/To/PEAR/Base/Dir/Pager/'); require(PAGER_DIR . 'Pager.php'); require(PAGER_DIR . 'Pager_Wrapper.php'); I recommend reading up on include_path: http://nl2.php.net/manual-lookup.php?pattern=INCLUDE_PATHlang=en http://nl2.php.net/manual/en/ini.core.php#ini.include-path have fun. I am using Apache/PHP on Windows. Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Requiring stuff question
Robert wrote: I have the following in a config file: // Define and require the Smarty library define('SMARTY_DIR', 'Smarty/'); require(SMARTY_DIR . 'Smarty.class.php'); // Define the pager stuff define('PAGER_DIR', 'Pager/'); require(PAGER_DIR . 'Pager.php'); require(PAGER_DIR . 'Pager_Wrapper.php'); // Define the DB package define('PEAR_DB', 'DB/'); require(PEAR_DB . 'DB.php'); The Smarty stuff works no problem. The DB and Pager stuff do not. Since I am new to PHP I may be just misunderstanding how to do it. PEAR requires that its path is in include_path. Use: ini_set('include_path', '/where/is/your/PEAR/:' . ini_get('include_path')); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Requiring stuff question
On 5/23/05, Marek Kilimajer [EMAIL PROTECTED] wrote: Robert wrote: I have the following in a config file: // Define and require the Smarty library define('SMARTY_DIR', 'Smarty/'); require(SMARTY_DIR . 'Smarty.class.php'); // Define the pager stuff define('PAGER_DIR', 'Pager/'); require(PAGER_DIR . 'Pager.php'); require(PAGER_DIR . 'Pager_Wrapper.php'); // Define the DB package define('PEAR_DB', 'DB/'); require(PEAR_DB . 'DB.php'); The Smarty stuff works no problem. The DB and Pager stuff do not. Since I am new to PHP I may be just misunderstanding how to do it. PEAR requires that its path is in include_path. Use: ini_set('include_path', '/where/is/your/PEAR/:' . ini_get('include_path')); Ah! Thanks! Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php