Shell problems

Two issues, possibly related.

  1. I have frequently used chsh to change my shell from ksh to bash. The change will persist for a while, but ultimately revert back to ksh in /etc/passwd

  2. I am currently unable to execute php scripts from the command line.

[yoda]$ php script.php
-bash: php: command not found
[yoda]$ php -v
-bash: php: command not found
[yoda]$ echo $PATH

All scripts executed through http seem to be working.

The change is more permanent if you make it in the Panel. Manage Users, Edit the user, User Account Type.

Finding php should be a matter of getting the path right, as you know. You are close.



$ whereis php
php: /etc/php /usr/local/bin/php /usr/local/lib/php

$ whereis php5
php5: /etc/php5 /usr/local/php5
Promos: MaxTOR: Save [color=#CC0000]Maximum[/color] TOR: Save Maximum and [color=#00CC00]give $1 to TOR[/color]

First, log into the Panel > Users > Manage Users, edit your user and set your which you want to use ksh or bash. The effect should hold, but may take up to an hour to take effect.

Next, have you edited .bash_profile or an equivalent for ksh? That perhaps might be the problem, but that’s just a guess. I’d do the above change and then see if your problems clear up. If not, contact support.

–Matttail - personal website


Thanks for the panel suggestion.

As to not finding php, I’ve been using shell access here since 2004 - ksh, through a putty terminal. Never had a problem before. There is currently no .profile in my home directory, and I can assure you that I didn’t delete it.

My .bash_profile was essentially empty:

~/.bash_profile: executed by bash(1) for login shells.

umask 002
PS1=’[\h]$ ’

I don’t even know where my PATH was being set.

Nevertheless, it is now set to:


in .bash_profile

but I’m still getting errors:

[yoda]$ which php
[yoda]$ whereis php
php: /etc/php /usr/local/lib/php
[yoda]$ php -v
-bash: php: command not found

Also, there is no php in /usr/local/bin on yoda

seems to me that your shell got messed up some how, I’d contact support.

–Matttail - personal website