Update failed 5.8 to latest after php upgrade

5.8

Environment Ubuntu 22.04

Checklist

Describe the bug

updated to php 8.3 from 8.1. Update for invoiceninja failed, when i refreshed the page i have this error:
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.2.0".

I upgraded composer to 2.8.9 but the error just stays there, so i’m not sure if there’s something i need to do or run to clear it and start the update again.

Realized i didn’t uninstall php8.1 or php8.1-fpm, even though cli showed 8.3 and the 8.1 service wasn’t running.

now i’m getting this after uninstalled 8.1:

*/ define('LARAVEL_START', microtime(true)); /* |-------------------------------------------------------------------------- | Register The Auto Loader |-------------------------------------------------------------------------- | | Composer provides a convenient, automatically generated class loader for | our application. We just need to utilize it! We'll simply require it | into the script here so that we don't have to worry about manual | loading any of our classes later on. It feels great to relax. | */ require __DIR__.'/../vendor/autoload.php'; /* |-------------------------------------------------------------------------- | Turn On The Lights |-------------------------------------------------------------------------- | | We need to illuminate PHP development, so let us turn on the lights. | This bootstraps the framework and gets it ready for use, then it | will load up this application so that we can run it and send | the responses back to the browser and delight our users. | */ $app = require_once __DIR__.'/../bootstrap/app.php'; /* |-------------------------------------------------------------------------- | Run The Application |-------------------------------------------------------------------------- | | Once we have the application, we can handle the incoming request | through the kernel, and send the associated response back to | the client's browser allowing them to enjoy the creative | and wonderful application we have prepared for them. | */ $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); $response = $kernel->handle( $request = Illuminate\Http\Request::capture() ); $response->send(); $kernel->terminate($request, $response); 

Did you update your conf file to point to the new FPM location?

which conf file? that wasn’t in any doc i read?

If you’re using NGINX, you have to update the conf file to point to the new FPM location. You’d have to figure this out for your config as there’s a number of possible locations.

This helped me: Invoice Ninja v5 - Updating to v5.5.1 and Upgrading PHP to v8.1 - Software & Web Applications - Lawrence Systems Forums

i’m using apache. all of this appears to be related to composer, after it was installed invoice ninja and nextcloud both broke, spitting out what appears to be code.

If you use the release tar to setup the app you can avoid using composer

I’m not sure that will help now… something is broken after updating to php8.3 and composer 2.8.9

This is what i’m getting visiting the Url now.

What do you see when you run composer install

scratch that.. (i was in the wrong directory)

Your lock file does not contain a compatible set of packages. Please run composer update

If i run this, because i don’t think the update for invoice ninja took, will it break it?

You shouldn’t run composer update, only install

As a workaround you can try copying the vendor folder from the release tar

do these composer commands need to be run as root or www-data?

nm… i’m dumb. www-data and the vendor file worked.

Glad to hear it, thanks for the update!

still have the issue of it showing code from laravel and not actually processing php… so i’ve done something else wrong.

I’m not sure, here’s what ChatGPT suggests in case it’s helpful:

This issue is most likely due to Composer caching the old PHP version or not using the correct PHP binary when you run it.

Here’s how you can troubleshoot and fix the issue:


:white_check_mark: Checklist to Resolve PHP Version Error in Composer

1. Confirm PHP CLI version

Make sure that your terminal is using PHP 8.3:

php -v

If it still shows PHP 8.1, you may need to switch versions using update-alternatives:

sudo update-alternatives --config php

Choose the PHP 8.3 option from the list.


2. Clear Composer cache

Sometimes Composer caches platform info. Clear it:

composer clear-cache

3. Regenerate the autoload and lock files

If composer.lock still references the old PHP version, regenerate dependencies:

composer update --ignore-platform-reqs

:warning: Use --ignore-platform-reqs only temporarily to regenerate composer.lock, then rerun without it to validate.


4. Check PHP path used by Composer

Ensure Composer is using the correct PHP version:

which php
composer -vvv about

Look for lines like:

Running 1.10.x with PHP 8.1.x

If it’s showing the wrong PHP version, you may need to call Composer explicitly with PHP 8.3:

php8.3 /usr/local/bin/composer update

(adjust the path to your PHP 8.3 binary and Composer binary)


5. Restart services (optional)

If you’re running through web server (Apache/Nginx + PHP-FPM), restart the PHP service:

sudo systemctl restart php8.3-fpm

none of that worked, Not sure what’s wrong. If i should uninstall php and composer completely or if there is some config somewhere causing this. i’ve restarted several times.

It may help to try setting up a clean install of the app and then copy over the database and .env file.