Tuesday, March 13, 2007

Getting pear modules installed on dreamhost

Scratch notes here. Go here for workable sequence.

Step 1:
/usr/local/php5/bin/pear config-create $HOME .pearrc ==>
Could not create ".pearrc"

running pear config-show has User configuration file set to /home/[myaccount]/.pearrc which is what i would expect the first step to accomplish, assuming this step has already been accomplished for me.

Running /usr.../pear install Net_URL ==>
Cannot install, php_dir for channel "pear.php.net" is not writeable by the current user

The .pearrc file did not actually exist there, it was set to live there by the pear config-show, but since the file doesn't exist, it makes sense that i need to create it. i attempted to upload an empty file, but got the message ERROR: The default config file is not a valid config file or is corrupted.

Found this resource:
http://www.appelsiini.net/~tuupola/doc/peardoc/installation.shared.html not much help

/usr/local/php5/bin/pear config-create /home/[myaccount]/pear/ .pearrc
this resulted in a run, but the file does not appear to have created any file. however it did reset the user configuration file path to /home/.martin/[myaccount]/.pearcc which is interesting because i told it to use the /pear subdir.

/usr/local/php5/bin/pear config-create $HOME/pear .pearrc
same result, with the same user config file path

moving on...

executing /usr/local/php5/bin/pear install -o PEAR
this ran now, but there are still no new files anywhere

moving on...

executing /usr/local/php5/bin/pear install HTTP_Request
this ran as well.

moving on...
other dh.wiki readers seem to have the same problem identifying where to include the set include path code in the next step

attempting to put it in the code of the page itself....

actually, putting it in drupal settings.php file
ini_get( 'include_path' ) . PATH_SEPARATOR . "/home/.martin/[myuser]/pear/php"

since the files didn't actually get installed to the home/user/pear folder, i cannot see how the ini_set command could possibly work. nevermind. the files are there now, ftp was not refreshing and showing the files.

somehow, someway this worked. i have no idea how!

Workable sequence to get pear and http_request working on dreamhost installation:
/usr/local/php5/bin/pear config-create $HOME .pearrc
/usr/local/php5/bin/pear install -o PEAR
/usr/local/php5/bin/pear install HTTP_Request
ini_set( 'include_path', ini_get( 'include_path' ) . PATH_SEPARATOR . "/home/.martin/[username]/pear/php");