PDA

View Full Version : Php With Pear - Configuration Question



jrmnet
10-06-2004, 03:25 AM
How is Pear configured on the HostPC servers?

From looking at phpinfo(), it appears that PHP was configured with the option "--with-pear".

I've been trying to use QuickForm, with the following syntax for the include:

require_once "/HTML/QuickForm.php";

But when I do this, it can't seem to find PEAR, and returns the error:

Fatal error: main(): Failed opening required '/HTML/QuickForm.php' (include_path='.:/usr/local/lib/php')

I assume I need to add something to the require_once parameter to locate the PEAR directory, but I don't know what that is.

I'm trying to avoid uploading my own version of PEAR if it already exists somewhere on the server. An example would be greatly appreciated...

thevillageinn
10-06-2004, 10:26 AM
the path you are using in your include looks incorrect, unless you actually have a directory called "HTML"

this link to site-helper.com may help (http://www.site-helper.com/scripts.html#paths)

jrmnet
10-06-2004, 09:14 PM
Thanks for the response. No I don't have an HTML directory in my sites root folder.

I read the help at the link you provided, and it mainly talked about Perl and paths - no mention of PHPPear.

Is anyone successfully using Pear w/HostPC? Preferrably without having to upload and maintain a separate Pear package in their own directory...

thevillageinn
10-06-2004, 09:52 PM
I meant if your include file is referenced as being in /html/include.file and you don't have that corresponding path and file...it's not going to work

this is the typical path to the root html folder:
/home/username/domains/domain.com/public_html/
(http://www.domain.com/)

If you have a directory in there for the includes then it would look like this:
/home/username/domains/domain.com/public_html/includes/
(http://www.domain.com/includes)

If you wanted your includes to be out of the public eye, then you might reference the path like this:
/home/username/domains/domain.com/includes/

*or* (IIRC)

../includes/ (if your file were in the public_html directory.)

I hope that helps clarify my post earlier this morning. If it doesn't let me know, and feel free to post some specific examples.

jrmnet
10-09-2004, 02:01 AM
Yes, I understand that the require will not work if the path does not exist.

What I am trying to convey, is that from the results of the phpinfo command, it appears that the build of php that is running at HostPC already contains some type of reference to the PEAR library.

My issue is locating where this PEAR library is, so when I create a REQUIRE statement that is contructed with the correct path.

(I am trying to avoind uploading my own copy of the PEAR library).

-J

thevillageinn
10-09-2004, 12:28 PM
well, if you don't want to experiment further to find the proper path, and since no-one who knows (Joe or anyone who set up the servers) has piped up...why don't you just upload your own? Use of "QuickForm" is only dependent on another package "Common"

Clearly QuickForm package isn't in "/html". I would figure they may be somewhere off the include path of "/usr/local/lib/php" but the possibilities are endless.

I realize that pear could be easier to install, but it can be done via ftp.