PEAR Packages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPEAR Packages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 2nd, 2007, 02:39 PM
jay0316 jay0316 is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 5 jay0316 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 42 m 32 sec
Reputation Power: 0
Pear Structure

I'm pretty new to PEAR. I've got it installed and have been looking through the documentation and other sites. I can't find any info on the way it is organized. I have the main installation in "c:\xamp\php", but there is also a PEAR folder in my htdocs. The files in there look different.

Could someone explain what each folder is used for?

Also, I'm trying to get Pear: Pager to work. I've been following this tutorial http : // w w w . alberton.info/pear_pager_tutorial_database_results . h t m l . The php statements require files to make it work, but those files are in the Pear Installation folder. So, since they aren't in my htdocs folder I have to copy them, and I don't know where to copy them to. Each of those php files have others that they require within them, which then means copying more files.

When you install a package doesn't it put everything in place for it to work when you reference it?

Are you supposed to install pear in htdocs?

I am so confused. Thanks!

Jason

Last edited by jay0316 : November 2nd, 2007 at 02:42 PM.

Reply With Quote
  #2  
Old November 2nd, 2007, 03:38 PM
wiesemann wiesemann is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 172 wiesemann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 2 m
Reputation Power: 3
The include_path is the solution to your confusion. Set the include_path to
'.;c:\xamp\php'
(that means: current directory and c:\xamp\php) and require_once calls will work. There is no need to have the PEAR directory under your htdocs directory.

Reply With Quote
  #3  
Old November 2nd, 2007, 04:26 PM
jay0316 jay0316 is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 5 jay0316 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 42 m 32 sec
Reputation Power: 0
Ok. I checked out my include_path in my php.ini and it had '.;c:\xamp\php\pear' so, I changed it to '.;c:\xamp\php'. Now, according to the tutorial I'm following I have to "require" the Pager_Wrapper.php and MDB2.php. I previously copied those to my htdocs folder because I didn't think I could point to c:\xamp\php\pear\their_directory because this will eventually be on the website. Do you have to copy some of these files to the htdocs folder?

Here is the error I'm getting when I try to do a search using Pager:
Fatal error: Call to a member function queryCol() on a non-object in C:\xampp\htdocs\PEAR\Pager_Wrapper.php on line 209

When I open Pager_Wrapper.php it has require statements for other php files. There is no way its going to find them if they are in the pear folder on the c drive. Do I have to change all of those require statements or find all the files and move them into htdocs? I figured that it MUST be easier than what I'm making it.

Thanks.

Quote:
Originally Posted by wiesemann
The include_path is the solution to your confusion. Set the include_path to

(that means: current directory and c:\xamp\php) and require_once calls will work. There is no need to have the PEAR directory under your htdocs directory.

Reply With Quote
  #4  
Old November 2nd, 2007, 05:07 PM
wiesemann wiesemann is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 172 wiesemann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 2 m
Reputation Power: 3
Don't edit PEAR files - you would lose your changes on updates. There is also no need to copy them to another location.

Search for PEAR.php on your disk. Next to it, you should also find some subdirectories like PEAR or MDB2 or HTML (the last two depend on your installation, but PEAR will be there).

This is the directory that needs to be added to the include_path. My first suggestion was based on the path information that you wrote about. Once this setting points to the right location, all your PEAR packages will find their files and will work then.

Reply With Quote
  #5  
Old November 5th, 2007, 09:37 AM
jay0316 jay0316 is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 5 jay0316 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 42 m 32 sec
Reputation Power: 0
Thanks, wiesemann.

I think I'm understanding how this works a little better now. I was thinking that you have to put the require path from the page's location that is in the htdocs folder. So, I was thinking "how am I going to connect to a file that is outside of it." Now, I see that your setting it up so the require path starts from where the include path finishes.

Anyways, I think I have all my paths setup right; however, I'm still getting that same error that reads: "Fatal error: Call to a member function queryCol() on a non-object in C:\xampp\php\PEAR\Pager_Wrapper.php on line 209" Is querycol() a built in pear function? I can't figure out why it still can't find this.

Any more suggestions?

My php.ini file is now set to: ".;C:\xamp\php\pear". From that folder I can see the other PEAR folder as well as the Pager module folder etc.

Thanks.
Jason

Last edited by jay0316 : November 5th, 2007 at 10:02 AM.

Reply With Quote
  #6  
Old November 5th, 2007, 10:05 AM
wiesemann wiesemann is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 172 wiesemann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 2 m
Reputation Power: 3
queryCol() is a MDB2 function. You should find something like $db->queryCol() in C:\xampp\php\PEAR\Pager_Wrapper.php on line 209 (file and line as written in the error message). The message tells you that $db is not an object (and not a MDB2 instance), likely because something failed. Maybe your database credentials are wrong?

Reply With Quote
  #7  
Old November 5th, 2007, 10:06 AM
jay0316 jay0316 is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 5 jay0316 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 42 m 32 sec
Reputation Power: 0
Here is the line of code it is tripping up on:
$res =& $db->queryCol($query);

I think I found the function in MDB2.php if this helps.

function queryCol($query, $type = null, $colnum = 0)
{
$result = $this->query($query, $type);
if (!MDB2::isResultCommon($result)) {
return $result;
}

$col = $result->fetchCol($colnum);
$result->free();
return $col;
}

Reply With Quote
  #8  
Old November 5th, 2007, 11:11 AM
jay0316 jay0316 is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 5 jay0316 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 42 m 32 sec
Reputation Power: 0
Ok. I tested my database connection string to make sure it was working correctly and simplified my select statement. I printed out some results below the select statement, which is right before it hits the function giving me all the errors.

The connection string worked and printed out the results, but once it hit the function I got these errors:

Warning: preg_match() expects parameter 2 to be string, resource given in C:\xampp\php\PEAR\Pager_Wrapper.php on line 43

Warning: preg_match() expects parameter 2 to be string, resource given in C:\xampp\php\PEAR\Pager_Wrapper.php on line 44

Warning: preg_match() expects parameter 2 to be string, resource given in C:\xampp\php\PEAR\Pager_Wrapper.php on line 45

Warning: preg_match() expects parameter 2 to be string, resource given in C:\xampp\php\PEAR\Pager_Wrapper.php on line 52

Warning: preg_match() expects parameter 2 to be string, resource given in C:\xampp\php\PEAR\Pager_Wrapper.php on line 57

Fatal error: Call to a member function queryOne() on a non-object in C:\xampp\php\PEAR\Pager_Wrapper.php on line 203

Reply With Quote
  #9  
Old June 5th, 2009, 04:09 PM
walker222 walker222 is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 1 walker222 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 23 sec
Reputation Power: 0
ever figure this one out?

hey,

I know this a looong time down the line, but did you ever solve this problem? I believe I'm running into the exact some one on a Centos server.

I've checked the path and database connection, they're good.

-w

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPEAR Packages > Pear Structure


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek