-
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.
-
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
-
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.
-
You're welcome, mate. I'm glad to hear it's working now.