User ssh and php command

Discussion in 'Installation/Configuration' started by josecash, Apr 27, 2016.

  1. josecash

    josecash New Member

    Hi there,

    I'm using IspConfig for about 2 months, everything is fine but ssh users.

    I've created one ssh user for a client who has a symfony2 website, these framework comes with its own commands and one of them is
    php app/console cache:clear
    I've found this tutorial that explains how to add php command to jailkit but it gives lots of errors when I use jailkit option on chroot Shell.
    If I use the option, none, the command runs properly but the user has read access to all the filesystem...

    The php errors the command shows on jailkit are like:
    ...
    Warning: date_default_timezone_get(): Invalid date.timezone value 'Europe/Madrid', we selected the timezone 'UTC' for now.
    ...
    Note that the timezone Europe/Madrid is fine, I don't know why is that an invalid value...

    The worst part is warnings about dynamic libraries that can't be loaded... Like
    ...
    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/pdo.so' - /usr/lib/php5/20131226/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
    ...
    It causes Fatal errors when I run php commands that requires any of these libraries.

    The question is: Can I use the option none for chroot Shell and limit the user to its website folder? If not...What can I do?
    Thanks.
     
    Last edited: Apr 29, 2016
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The jail is what's limits a shell user to its home directory, so no jail = no limitation.

    Correct the timezone in the php.ini file copy of the jail.
     
  3. josecash

    josecash New Member

    The timezone is fine Europe/Madrid...
    Anyway the worst are libraries that can't be loaded, I've checked they are all there...
    ...
    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/pdo.so' - /usr/lib/php5/20131226/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
    ...
     
  4. josecash

    josecash New Member

    I've found out the failing path is related to the jailkit root path and not the system root path, so in my case I have copied all .so files from the system to the same path within the jailkit, doing that the php5 command can now load all libraries. One of problems is gone with this workaround.

    Still persist the error:
    PHP Warning: date(): Invalid date.timezone value 'Europe/Madrid', we selected the timezone 'UTC' for now. in php shell code on line 1

    PHP Fatal error: date(): Timezone database is corrupt - this should *never* happen! in php shell code on line 1

    I have tried with 'US/Central' as well with the same result, I have no idea about what's wrong with it...
     
    Last edited: May 5, 2016

Share This Page