www.webdeveloper.com
Results 1 to 4 of 4

Thread: [RESOLVED] A PEAR Question

  1. #1
    Join Date
    Oct 2005
    Location
    Knoxville Tennessee
    Posts
    79

    resolved [RESOLVED] A PEAR Question

    I am learning PEAR. In following the tutorials the first line is "require_once 'HTML/QuickForm.php';" which in my case cant be right. The html/quickform directory is back out in the root directory under php/HTML/quickform.

    If I just use the HTML/quickform line of course I get the error that the file doesnt exist and cant open it.

    When I come up with an address for it such as "/home/lunar/php/HTML/QuickForm.php'" then the Quickform error goes away and I get this error

    "Warning: require_once(HTML/Common.php) [function.require-once]: failed to open stream: No such file or directory in /home/lunar/php/HTML/QuickForm.php on line 33

    Fatal error: require_once() [function.require]: Failed opening required 'HTML/Common.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/lunar/php/HTML/QuickForm.php on line 33"

    My question is, Where exactly are the HTML/quickform and common files supposed to be? I tried to include the Common file as well but that didnt do anything.

    PEAR is installed through Cpanel into /home/domain/php. If this is correct, how on earth does one access PEAR with a command of "require_once 'HTML/QuickForm.php';" ?

    Should I copy the php/HTML directory out of the root and into public_html?

    Thanks, Im really confused on how to access or address this to get a simple form to work. The same question will probably be next with HTML_Table which of course is in the HTML directory

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,145
    The simplest thing will be to add the PEAR directory to your PHP include_path setting. You can do this at the php.ini level, or the directory level via a .htaccess setting, or per script via the set_include_path function.
    PHP Code:
    <?php
    set_include_path
    (get_include_path().PATH_SEPARATOR.'/home/domain/php');
    require_once 
    'HTML/QuickForm.php';
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Oct 2005
    Location
    Knoxville Tennessee
    Posts
    79
    Thank you nogdog, Very much appreciated. I have never had to work backwards out of the public_html directory before.

  4. #4
    Join Date
    Oct 2005
    Location
    Knoxville Tennessee
    Posts
    79
    Thanks again, that worked perfectly

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles