Debian 11 default php 7.4 > php artisan optimize

Discussion in 'General' started by onastvar, Aug 22, 2023.

  1. onastvar

    onastvar Member

    I'm having issues with invoice ninja app

    When I run “php artisan optimize” via command prompt I get:

    Composer detected issues in your platform:

    Your Composer dependencies require a PHP version “>= 8.1.2”. You are running 7.4.33.

    PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.1.2”. You are running 7.4.33. in /var/www/clients/client1/web1/web/billing/vendor/composer/platform_check.php on line 24

    My server runs Debian 11 which ships with php 7.4 as default. It's not recommend to change default php version on the system. I have additional php versions installed: php 8.1 & php 8.2, which I assigned to the website where invoice ninja is installed.

    Is there a way to run php 8.2 “php artisan optimize” via command?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Sure, use PHP 8.1 for it instead of PHP 7.4. E.g.:

    php8.1 artisan optimize
     
    onastvar likes this.
  3. onastvar

    onastvar Member

    thank you @till
    when I run "php8.1 artisan optimize" I see

    In Container.php line 891:
    Target class [db.schema] does not exist.
    In Container.php line 889:
    Class "db.schema" does not exist

    Am I missing something else?
     
  4. pyte

    pyte Well-Known Member HowtoForge Supporter

    You should check the docs and help forums of the product you are using there or the lavarel forums/help directly.
     
    onastvar and ahrasis like this.
  5. onastvar

    onastvar Member

    Does anyone know how to run composer under php8.1 (additional php8.1 already installed)?

    When I run "composer update" I see this message?

    composer.json requires php ^8.1 but your php version (7.4.33) does not satisfy that requirement.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    First, find the path where composer is with:

    which composer

    then use that path like this:

    php8.1 -f /usr/local/bin/composer update

    Btw. you can find plenty of results by googling for "run composer with another php version" as that#s all not ISPConfig specific.
     
  7. onastvar

    onastvar Member

    Thank You @till that worked perfectly!
     

Share This Page