Can I make cli's PHP match my ISPC web PHP version?

Discussion in 'General' started by schwim, Mar 17, 2024.

  1. schwim

    schwim Member HowtoForge Supporter

    Hello there, everyone

    I've chosen 8.3 for a website which is working fine but when I SSH on a user and try to use composer to install some PHP classes, it's causing issues because my PHP version while SSHed in is different than the version on the web site.

    Can I get php cli to match 8.3 for that SSH user that's trying to work on the website?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You can run composer with any PHP version that you have installed. Example:

    Code:
    php8.2 -f /usr/local/bin/composer update
     
    ahrasis likes this.
  3. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    you can set them as aliases, so that you can just keep using php on it's own instead of specifying the full path, or individual php version...
    https://www.cyberciti.biz/faq/create-permanent-bash-alias-linux-unix/

    would be nice if it was done automatically, and updated automatically when a site's php version is changed, so that just using the 'php' command on it's own was always matched to the php version assigned to the website..
    not sure how much work that would be to implement though..
     
    ahrasis likes this.
  4. michelangelo

    michelangelo Active Member

    Your wish could come true sooner than you think... I currently work on that feature, see: https://git.ispconfig.org/ispconfig/ispconfig3/-/merge_requests/1829
     
    ahrasis, till and nhybgtvfr like this.

Share This Page