Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.16

Bug #8611 can't install as a non-root user
Submitted: 2006-09-01 17:12 UTC
From: geocar at internetconnection dot net Assigned:
Status: No Feedback Package: PEAR (version 1.4.11)
PHP Version: Irrelevant OS: Debian 3
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 49 - 9 = ?

 
 [2006-09-01 17:12 UTC] geocar at internetconnection dot net (Geo Carncross)
Description: ------------ Installing as a non-root user fails if the home directory is not found off the root, or off a directory that is off the root. To reproduce: make a user with the home directory /usr/local/someplace/users/yourusername The permissions for yourusername should be 0750, and the user doesn't belong the group that "owns" his home directory. Install _always_ fails with an error "cannot create /usr/local/someplace/users/yourusername" I worked around the problem by making a symlink in /yourusername, performed the install, then used fine . -type f -print0 |xargs -0 perl -p -i -e 's/\/yourusername/\/usr\/local\/someplace\/users\/yourusername/sg' and fixing up php.ini to point to the PEAR directory.

Comments

 [2006-09-01 21:01 UTC] pajoye (Pierre-Alain Joye)
What do you use to install pear? gopear, php releases? I fail to follow you. If the directory does not exist before the install and the user does now have the permissions to create it, I do not see any bug here.
 [2006-09-02 16:59 UTC] geocar at internetconnection dot net
I attempted to use gopear. The directory does already exist. It shouldn't matter if the user has the ability to create the directory or not.
 [2006-09-02 19:03 UTC] pajoye (Pierre-Alain Joye)
"The directory does already exist." Ok, and what is the permissions/owner of this directory and which which user to you run go-pear? "It shouldn't matter if the user has the ability to create the directory or not." If it does not exist, it obviously does matter. But this is not the case here.
 [2006-09-02 19:38 UTC] geocar at internetconnection dot net
``Ok, and what is the permissions/owner of this directory and which which user to you run go-pear?'' I create a user: mkdir -p /usr/share/web chown root:root /usr/share/web chmod 0711 /usr/share/web useradd -d /usr/share/web/foo -g users foo chown foo:www /usr/share/web/foo chmod 0750 /usr/share/web/foo foo logs in, and copies the php.cgi into ~/cgi-bin/php5 and runs: $ PATH=$HOME/cgi-bin:$PATH $ export PATH $ lynx -source http://pear.php.net/go-pear \ | php5 as following the instructions, prefix is set to /usr/share/web/foo install proceeds, after unpacking PEAR, and setting up config (attempting to create pear.conf) install aborts complaining that /usr/share/web/foo already exists. If I ln -s /foo /usr/share/web/foo and run the install setting the "prefix" to /foo, and then editing all cases of /foo then install will succeed. "It shouldn't matter if the user has the ability to create the directory or not." If it does not exist, it obviously does matter. But this is not the case here. No, even if it doesn't exist. the installer should mkdir and ignore its error code. It should instead test success using chdir, or opendir, or even by attempting to create a file in there (if its really attempting to test writability), or similar. It should _not_ attempt_ to predict whether creating the directory will fail.
 [2006-09-02 20:37 UTC] pajoye (Pierre-Alain Joye)
Please tell me the exact error messages. It really does not matter how you create all these directories. My point is to understand what you do and where it fails. It works perfectly here (doing exactly what you said and running go-pear using the user"foo"), the only requirement is that the prefix directory is writable for the user running go-pear (foo in this case). I feel like you are setting the wrong permissions, but it is not an installer bug.
 [2006-09-02 21:14 UTC] geocar at internetconnection dot net
Welcome to go-pear! Go-pear will install the 'pear' command and all the files needed by it. This command is your tool for PEAR installation and maintenance. Go-pear also lets you download and install the PEAR packages bundled with PHP: MDB2. If you wish to abort, press Control-C now, or press Enter to continue: HTTP proxy (http://user:password@proxy.myhost.com:port), or Enter for none:: Below is a suggested file layout for your new PEAR installation. To change individual locations, type the number in front of the directory. Type 'all' to change all of them or simply press Enter to accept these locations. 1. Installation prefix : /usr/local 2. Binaries directory : $prefix/bin 3. PHP code directory ($php_dir) : $prefix/share/pear 4. Documentation base directory : $php_dir/docs 5. Data base directory : $php_dir/data 6. Tests base directory : $php_dir/tests 7. Temporary files directory : $prefix/temp 1-7, 'all' or Enter to continue: 1 Installation prefix [/usr/local] : /usr/share/web/jpetit Below is a suggested file layout for your new PEAR installation. To change individual locations, type the number in front of the directory. Type 'all' to change all of them or simply press Enter to accept these locations. 1. Installation prefix : /usr/share/web/jpetit 2. Binaries directory : $prefix/bin 3. PHP code directory ($php_dir) : $prefix/share/pear 4. Documentation base directory : $php_dir/docs 5. Data base directory : $php_dir/data 6. Tests base directory : $php_dir/tests 7. Temporary files directory : $prefix/temp 1-7, 'all' or Enter to continue: mkdir failed: </> Unable to create PHP code directory ($php_dir) /usr/share/web/jpetit/share/pear.Run this script as root or pick another location. jpetit@hermes:~$ ls -ld . drwxr-x--- 14 jpetit www 4096 Sep 1 17:06 . jpetit@hermes:~$ pwd /usr/share/web/jpetit jpetit@hermes:~$ ls -dl share/pear/ drwxr-xr-x 13 jpetit users 4096 Sep 2 21:12 share/pear/
 [2006-09-02 22:12 UTC] pajoye (Pierre-Alain Joye)
"mkdir failed: </> Unable to create PHP code directory ($php_dir)" This is the problem. It tries to create the / directory. Which php version do you use? I cannot reproduce it here, is it possible to get an access to your host (mail me if yes, pierre@php.net).