1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Php cli + ssh chroot

Discussion in 'Plesk 11.x for Linux' started by futureweb, Oct 17, 2012.

  1. futureweb

    futureweb Regular Pleskian

    28
    23%
    Joined:
    Feb 4, 2007
    Messages:
    186
    Likes Received:
    4
    Location:
    Tirol, Austria
    Php cli + ssh chroot (solved)

    Hey there,

    I got a little Problem with SSH CHROOT - I need CLI PHP in some of our SSH CHROOT.
    So far so good - PHP binary, some libraries ... and everything looks good.

    But there is one weird thing - everytime I start PHP on CLI I get this error: No entry for terminal type "linux";
    And I just can't figure it out how to get rid of this error?

    Hope someone here can help me on this

    Thank you
    Andreas Schnederle-Wagner
     
    Last edited: Oct 19, 2012
  2. abdi

    abdi Platinum Pleskian

    31
    18%
    Joined:
    May 14, 2006
    Messages:
    2,913
    Likes Received:
    60
    Andreas are you running php with full cgi-path? ie /usr/bin/php -f <full-path-to>
     
  3. futureweb

    futureweb Regular Pleskian

    28
    23%
    Joined:
    Feb 4, 2007
    Messages:
    186
    Likes Received:
    4
    Location:
    Tirol, Austria
    Hi,

    same error if calling "php" or "/bin/php" - guess "/bin/" is in ENV PATH in chroot ...

    Andreas
     
  4. abdi

    abdi Platinum Pleskian

    31
    18%
    Joined:
    May 14, 2006
    Messages:
    2,913
    Likes Received:
    60
    You may have to switch those users to /bin/bash (Domain settings). Since that errors indicates loading php on a linux terminal which is not existant.
     
  5. futureweb

    futureweb Regular Pleskian

    28
    23%
    Joined:
    Feb 4, 2007
    Messages:
    186
    Likes Received:
    4
    Location:
    Tirol, Austria
    Well - under Domain settings I got "/bin/bash (chrooted)" - no idea why PHP thinks it runs on linux Terminal!
    And I found some other problems - all shared PHP Modules are not loaded into chrooted PHP etc. etc. etc.

    Anyone got PHP running without problems in Plesk CHROOT environment? Maybe some tips how to do?

    thank you
     
  6. futureweb

    futureweb Regular Pleskian

    28
    23%
    Joined:
    Feb 4, 2007
    Messages:
    186
    Likes Received:
    4
    Location:
    Tirol, Austria
    Was able to get rid of the "no entry for terminal type" error by copying the terminfo into chroot
    (/var/www/vhosts/DOMAIN/lib/terminfo/*)

    I guess this implies no security threat, or?

    But still the problem with all the PHP modules - guess I have to pick every and also put it into chroot?
    With big troubles when updating PHP on Server ... every chroot env needs PHP / PHP Modules update too then?

    Andreas
     
    Last edited: Oct 17, 2012
  7. futureweb

    futureweb Regular Pleskian

    28
    23%
    Joined:
    Feb 4, 2007
    Messages:
    186
    Likes Received:
    4
    Location:
    Tirol, Austria
    alright ... for everyone who want's to do the same:

    I compiled an extra PHP Version for CLI:
    so whole php is located at "/usr/local/php5318-cgi/" ... then I had to copy severy lib64 libraries to the chroot - and now I got a working PHP install with all needed featues under my chroot
     
  8. abdi

    abdi Platinum Pleskian

    31
    18%
    Joined:
    May 14, 2006
    Messages:
    2,913
    Likes Received:
    60
    Great, thanks for sharing that information.
     
Loading...