Top VPS Hosting Provider

Welcome to the myhosting.com Forums.
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    sgoodman is offline Master Member
    Join Date
    Jul 2008
    Location
    Alberta, Canada
    Posts
    397

    Question Trying to Install Pear

    Greetings,

    I'm trying to install Pear using these instructions:

    Manual :: Installation of a local PEAR copy on a shared host

    However, after it is installed, the PEAR Package Manager gives me the following error:

    Warning: realpath() [function.realpath]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/domains/popupsinc.com/:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/www/myfilemanager:/var/www/myinstaller:/usr/local/lib/php) in /var/www/domains/popupsinc.com/docs/mypear/PEAR/System.php on line 474

    Are there any server restrictions that would prevent Pear from being installed? Otherwise, if anyone had some troubleshooting tips, I would appreciate it.

    I'm on the Basic Linux Hosting Plan.

    Thanks,
    Shane.

  2. #2
    nickh is offline Administrator
    Join Date
    May 2009
    Location
    Toronto, Canada
    Posts
    142

    Default

    Hi Shane. That error's occurring because something is trying to perform a filesystem operation within /tmp/ . For security reasons, shared hosting accounts aren't allowed to touch /tmp/ .

    If you search Google for "pear open_basedir /tmp", you'll get a bunch of results. These two in particular helped me solve the problem:
    All you need to do is modify index.php in your PEAR directory so that the first lines look like this:
    PHP Code:
    <?php
    putenv
    ('TMPDIR=' $_SERVER['DOCUMENT_ROOT'] . '/temp/');
    Cheers,
    Nick
    Nick Hoffman
    Software Developer
    SoftCom Inc.

  3. #3
    sgoodman is offline Master Member
    Join Date
    Jul 2008
    Location
    Alberta, Canada
    Posts
    397

    Smile Fixed

    Hi Nick,

    I inserted this line of code:

    PHP Code:
    putenv('TMPDIR=' ini_get("upload_tmp_dir")); 
    And the error messages went away.

    Thanks for your help. I've been working on this problem for a long time.

    Sincerely,
    Shane.

  4. #4
    nickh is offline Administrator
    Join Date
    May 2009
    Location
    Toronto, Canada
    Posts
    142

    Default

    You're welcome, mate. I'm glad to hear it's working now.
    Nick Hoffman
    Software Developer
    SoftCom Inc.


 

Posting Permissions

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