+ Reply to Thread
Results 1 to 4 of 4

Thread: php and pear

  1. #1
    selcane is offline x10Hosting Member selcane is an unknown quantity at this point
    Join Date
    Nov 2008
    Posts
    17

    php and pear

    i've tried to just include a pear library and it's not working:

    <?php
    require_once '/x10hosting/php2/pear/PEAR/Validate.php';
    echo "help";

    ?>

    I dont see anything in the cpanel allowing me to install any pear packages. Is it allowed with a free account? maybe i need to upgrade php? how do i do that?

    the reason i need the pear packages is for a secure contact us form.
    i wrote a contact us php script which uses pears mail package to prevent mail injection and the validate package to prevent spam.

  2. #2
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: php and pear

    try the following code
    PHP Code:
    <?php
    require_once 'Validate.php';
    echo 
    "help";
    ?>
    However, I've also created my own personal installation using the go-pear script, through the browser.
    Last edited by xav0989; 03-06-2009 at 01:08 PM.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

  3. #3
    selcane is offline x10Hosting Member selcane is an unknown quantity at this point
    Join Date
    Nov 2008
    Posts
    17

    Re: php and pear

    Hi, thanks for the response, i tried what u said, but still didnt work. i'm gonna try the go-pear thing, thanks for telling me about it!
    Edit:
    Hi, thanks for the response,
    i also tried the go-pear thing, thanks for telling me about it,
    but now i dont know what to do. i dont see the mail and validate classes there.
    i dont know how to install the validate and mail packages, plus they each have dependencies on other packages. there should really be a link from the cpanel to allow pear package instalations. can you tell me how to install the validate and mail packages? thanks
    Last edited by selcane; 03-07-2009 at 06:31 AM. Reason: Automerged Doublepost

  4. #4
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: php and pear

    To check if it works, use the code below
    PHP Code:
    <?php
    require_once 'System.php';
    var_dump(class_exists('System'));
    ?>
    Should output "bool(true)". If it doesn't, add your local copy of pear to the include path (add this to the top of the script
    PHP Code:
    set_include_path('where/your/local/copy/is' PATH_SEPARATOR get_include_path()); 
    => see http://pear.php.net/manual/en/installation.checking.php


    I don't have it configured on my server right now, but if I remember well, to install new packages you need to go to the web based package manager that was added in one of the web access folders you specified.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

+ Reply to Thread

Similar Threads

  1. PHP PEAR DB.php
    By luckysev in forum Programming Help
    Replies: 0
    Last Post: 03-26-2008, 04:04 PM
  2. Replies: 0
    Last Post: 07-05-2005, 10:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers