5.5.1 Upgrade failure

At least in my distro, the apt version of composer is 1.0. So if you did installed it with apt or another package manager, uninstall it with the package manager and install it manually. It’s pretty simple to install: https://getcomposer.org/doc/00-intro.md#locally

Have you updated the FPM socket in your nginx to php8.1-fpm ?

I have Apache but will check

@david - php8.1-fpm socket installed properly and enabled against Apache

@Stevan - download and installed composer 2.3.10 per your recommendation.

Still getting the following message when browsing to the site: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.1.0”.

Will call it an evening for now so will continue at it in the morning.

I do want to thank you all for the support throughout my afternoon and evening! Will hopefully find the solution tomorrow.

Best regards
Jose

I think you should now be able to do composer update and then composer install -o --no-dev

I don’t think apache is hooked into the right version of PHP, this is the only way this error could appear in the browser.

Hello @Stevan

The composer that is installed doesn’t seem to have the “-o --no-dev” arguments. Here’s a listing of what my composer outputs for options and arguments:

Composer version 2.3.10 2022-07-13 15:48:23

Usage:
command [options] [arguments]

Options:
-h, --help Display help for the given command. When no command is given display help for the list command
-q, --quiet Do not output any message
-V, --version Display this application version
–ansi|–no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
–profile Display timing and memory usage information
–no-plugins Whether to disable plugins.
–no-scripts Skips the execution of all scripts defined in composer.json file.
-d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
–no-cache Prevent use of the cache
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
about Shows a short information about Composer.
archive Creates an archive of this composer package.
browse [home] Opens the package’s repository URL or homepage in your browser.
check-platform-reqs Check that platform requirements are satisfied.
clear-cache [clearcache|cc] Clears composer’s internal package cache.
completion Dump the shell completion script
config Sets config options.
create-project Creates new project from a package into given directory.
depends [why] Shows which packages cause the given package to be installed.
diagnose Diagnoses the system to identify common errors.
dump-autoload [dumpautoload] Dumps the autoloader.
exec Executes a vendored binary/script.
format Runs the format script as defined in composer.json.
fund Discover how to help fund the maintenance of your dependencies.
global Allows running commands in the global composer dir ($COMPOSER_HOME).
help Display help for a command
init Creates a basic composer.json file in current directory.
install [i] Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
licenses Shows information about licenses of dependencies.
list List commands
outdated Shows a list of installed packages that have updates available, including their latest version.
prohibits [why-not] Shows which packages prevent the given package from being installed.
reinstall Uninstalls and reinstalls the given package names
remove Removes a package from the require or require-dev.
require Adds required packages to your composer.json and installs them.
run-script [run] Runs the scripts defined in composer.json.
search Searches for packages.
self-update [selfupdate] Updates composer.phar to the latest version.
show [info] Shows information about packages.
status Shows a list of locally modified packages.
suggests Shows package suggestions.
update [u|upgrade] Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file.
validate Validates a composer.json and composer.lock.

Make sure that composer v2 and php8.1 is running by checking composer -vvv about
And to run composer install -o --no-dev you need to be at the website’s root folder.

At the website’s root folder, run composer update then composer install -o --no-dev

@david - I reverted back and reinstalled it all manually. I know I have PHP 8.1 with all the modules installed correctly but get the following at the end of the upgrade:

FormatException: SyntaxError: Unexpected token C in JSON at position 0

When I dismiss this message and refresh the page, I then get the following:

Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.1.0”.

@CTG,

Try putting a phpinfo.php file with

<?php phpinfo(); ?>

In the /public directory and hit it from your webbrowser, this will show you your PHP configuration in the browser.

composer is reporting what it is seeing, and phpinfo should confirm that PHP 8.1 is not being loaded.

Hey @david

I did exactly what you reference and it did display the PHP 7.4.30 page. I’m not sure why or what I did wrong at this phase.

How do I switch IN to reference the v8.1 that is installed?

@CTG

If you are using apache, you’ll want to wire up MOD_PHP 8.1, it has been way too long since i’ve played with Apache, but that was how it was done a few years ago.

here is a reference guide from Vultr

https://www.vultr.com/docs/upgrade-from-php-7-to-php-8-on-ubuntu-20-04-with-apache/

@david & @Stevan

Thank you both for your guidance on this! After setting up the phpinfo page, I did notice that there was PHP v7.4 still running in the system. I ran a bunch of commands and removed all signs, and any version of PHP then reinstalled 8.1 cleanly. I then updated the appropriate conf files related to the “sites-available” virtual directory and it all finally started to work!

Once again, appreciate the help!