PEAR, Shell Access and Putty


#1

Hi
A Newbie in DreamHost.
How do I install PEAR?
Can I use Putty?
Which Host UserName and Password must I use in Putty?
Thx

Johan van Zyl


#2

Yes, you should be able to install PEAR modules through ssh. See the Wiki article on SSH for help on how to connect to your server via SSH (and putty)

–Matttail
art.googlies.net - personal website


#3

Looks like I installed PEAR ok but now I get:
Fatal error: Class ‘HTML_Common’ not found in /home/.hilarius/tibxuser/tibx.net/phpant/AccessControl/HTML/QuickForm.php on line 115

Johan van Zyl


#4

If you have installed PEAR locally you can type pear list to see if the HTML_Common module is shown. If not then install it with:-

pear install -o HTML_Common

and you will get…

downloading HTML_Common-1.2.2.tgz …
Starting to download HTML_Common-1.2.2.tgz (4,240 bytes)
…done: 4,240 bytes
install ok: channel://pear.php.net/HTML_Common-1.2.2

You can check again with:-

pear list

There are over 300 PEAR modules so you will have to install the one you need. Some modules have dependencies on other modules so use the -o option to download and install any required deependencies. You can use the -a option if you like which will download required and ‘optional’ dependencies.


Norm

Opinions are my own views and not the views of DreamHost. :open_mouth:
Any advice offered by me should be acted upon at your own risk.


#5

Thx!
When I now log into Putty I get:
command not found
octal number out of range
???

Johan van Zyl


#6

Did I really have to put this in my .bash_profile
Iwas suggested: PHP_PEAR_PHP_BIN=/usr/local/php5/bin but then I realised that I have PHP4 so I changed that to
PHP_PEAR_PHP_BIN=/usr/local/php4/bin

DEFAULT_DH_ACCOUNT_PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
PEAR_LOCAL=/home/uid/domain.net/localpear/pear
PHP_PEAR_PHP_BIN=/usr/local/php4/bin
PATH=$PEAR_LOCAL:$PHP_PEAR_PHP_BIN:$DEFAULT_DH_ACCOUNT_PATH

Johan van Zyl


#7

OK, I see that if I just ignore that and Install PEAR packages anyway then it seems to install OK - but I still get this:
Fatal error: Call to undefined method HTML_QuickForm::clearAllTemplates() in /home/.hilarius/tibxusr/tibx.net/phpant1/AccessControl/7.php on line 84
after a successful install of HTML_QuickForm.
It would not Install HTML_QuickForm2 though?
Thx!

Johan van Zyl


#8

If you write to and save .bash_profile using an FTP editor you will sometimes get this error.
To correct it, log in with Putty (ignoring the error) then use :-
pico -w .bash_profile
to open the file.

Add a space/character somewhere then delete same space/character just to get the modified marker to show.
Now close and save back to .bash_profile with control-o and then control-x
Log off and then back in with Putty and it should be okay.

I did not add those lines to the bash profile I use the lines added to each PHP file as needed.

(This is my .bash_profile if you lose anything :slight_smile: )
umask 002
PS1=’[\u@\h \w]\$ '
alias l=‘ls -als | more’

Where the PS1 environment setting just makes the prompt show me which dimension/universe I am in and the alias is just me being lazy in typing l instead of list!

I think my original domain used PHP4 so I am running PEAR under PHP4 but it will run okay if you use PHP5 on another domain providing you add the lines to your PEAR setup as per the wiki.

Try repeating pear install -a HTML_Common again but this time use the -a option option. It will just overwrite the one already downloaded but may include optional HTML modules as well. If not just install the pear module you ned as per the error the message.


Norm

Opinions are my own views and not the views of DreamHost. :open_mouth:
Any advice offered by me should be acted upon at your own risk.


#9

Thx!
Now my prompt says:
[jvzsys@ciclet ~] $
Is that OK?
The other problems “octal” etc have gone away.
THX again!

Johan van Zyl


#10

HI
I still get this even though I have done what you said.
When I:
$ pear list
then HTML_QuickForm is listed.
Fatal error: Call to undefined method HTML_QuickForm::clearAllTemplates() in /home/.hilarius/tibxusr/tibx.net/tibxtest/7.php on line 81

Johan van Zyl


#11

Yes your prompt is okay. As you move to various folders it will change so that you know where you are.

If you have the modules installed okay then it may be an error in the PHP code. You might want to just jot down what PHP scripts you are using and/or trying to achieve so that it may assist another user to suggest some solutions.

I presume you have altered the include_path in your PHP program that uses your local PEAR modules?
You need something as per the wiki page:-

ini_set(
‘include_path’,
ini_get( ‘include_path’ ) . PATH_SEPARATOR . “$HOME/pear/php”
);

Changing $HOME to /home/./

As an aside it is sometimes better to use instead of your actual username since these posts get googlebotolised and there are some funny people about!


Norm

Opinions are my own views and not the views of DreamHost. :open_mouth:
Any advice offered by me should be acted upon at your own risk.


#12

Hi
Thx! You have been very helpfull.
I am not quite out of the woods yet - but getting there.

Johan van Zyl