<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">Hi,</p>
<p dir="auto">Just attempting to upgrade to the new 6.2.0 release on our development instance of IXP Manager.</p>
<p dir="auto">Running Ubuntu 20.04 with the ondrej PPA for PHP 8. Have just dist-upgraded to update everything.<br>
(deb <a href="http://ppa.launchpad.net/ondrej/php/ubuntu" style="color:#3983C4">http://ppa.launchpad.net/ondrej/php/ubuntu</a> focal main)</p>
<p dir="auto">Trying to run composer, first ran in to this:</p>
<p dir="auto">ixpmanager@portal:/srv/ixpmanager$ HOME=/srv/ixpmanager composer install --no-dev --prefer-dist<br>
Deprecation Notice: Required parameter $path follows optional parameter $schema in /usr/share/php/JsonSchema/Constraints/UndefinedConstraint.php:62<br>
Deprecation Notice: Required parameter $path follows optional parameter $schema in /usr/share/php/JsonSchema/Constraints/UndefinedConstraint.php:108<br>
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in /usr/share/php/Composer/Repository/RepositoryManager.php:130<br>
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in /usr/share/php/Composer/Repository/RepositoryManager.php:130<br>
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in /usr/share/php/Composer/Repository/RepositoryManager.php:130<br>
Loading composer repositories with package information<br>
Installing dependencies from lock file<br>
PHP Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php:84</p>
<p dir="auto">There is an issue here: <a href="https://github.com/composer/composer/issues/9097" style="color:#3983C4">https://github.com/composer/composer/issues/9097</a> - saying it’s fixed in the latest.</p>
<p dir="auto">root@portal:~# dpkg -l |grep compos<br>
ii composer 1.10.1-1</p>
<p dir="auto">So I did:<br>
$ wget <a href="https://getcomposer.org/download/2.1.12/composer.phar" style="color:#3983C4">https://getcomposer.org/download/2.1.12/composer.phar</a></p>
<p dir="auto">Which looks better, but then fails with another error:</p>
<p dir="auto">ixpmanager@portal:/srv/ixpmanager$ HOME=/srv/ixpmanager php ./composer.phar install --prefer-dist --no-dev<br>
Installing dependencies from lock file<br>
Verifying lock file contents can be installed on current platform.<br>
Package operations: 7 installs, 50 updates, 0 removals<br>
- Downloading composer/package-versions-deprecated (1.11.99.4)<br>
- Downloading symfony/polyfill-php80 (v1.23.1)<br>
[snip the rest of the package list]<br>
- Upgrading laravel/socialite (v5.2.3 => v5.2.5): Extracting archive<br>
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.<br>
Generating autoload files<br>
composer/package-versions-deprecated: Generating version class...<br>
composer/package-versions-deprecated: ...done generating version class</p>
<p dir="auto">Illuminate\Foundation\ComposerScripts::postAutoloadDump<br>
@php artisan package:discover</p>
<p dir="auto">In MemcachedConnector.php line 69:</p>
<p dir="auto">Class "Memcached" not found</p>
<p dir="auto">Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1</p>
<p dir="auto">….which it just won’t get past:</p>
<p dir="auto">ixpmanager@portal:/srv/ixpmanager$ HOME=/srv/ixpmanager php ./composer.phar install --prefer-dist --no-dev<br>
Installing dependencies from lock file<br>
Verifying lock file contents can be installed on current platform.<br>
Nothing to install, update or remove<br>
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.<br>
Generating autoload files<br>
composer/package-versions-deprecated: Generating version class...<br>
composer/package-versions-deprecated: ...done generating version class</p>
<p dir="auto">Illuminate\Foundation\ComposerScripts::postAutoloadDump<br>
@php artisan package:discover</p>
<p dir="auto">In MemcachedConnector.php line 69:</p>
<p dir="auto">Class "Memcached" not found</p>
<p dir="auto">Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1<br>
ixpmanager@portal:/srv/ixpmanager$</p>
<p dir="auto">Searching for MemcachedConnector.php, it’s at:<br>
./vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php</p>
<p dir="auto">And line 69 is the return statement:</p>
<p dir="auto">protected function createMemcachedInstance($connectionId)<br>
{<br>
return empty($connectionId) ? new Memcached : new Memcached($connectionId);<br>
}</p>
<p dir="auto">In fact, this isn’t a composer thing:</p>
<p dir="auto">ixpmanager@portal:/srv/ixpmanager$ php $IXPROOT/artisan migrate:status</p>
<p dir="auto">In MemcachedConnector.php line 69:</p>
<p dir="auto">Class "Memcached" not found</p>
<p dir="auto">Oddly I do now notice I’ve got a mix of PHP 8 and 8.1 installed?</p>
<p dir="auto">root@portal:~# dpkg -l |grep php | grep fpm<br>
ii php8.0-fpm 8.0.12-1+ubuntu20.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)</p>
<p dir="auto">root@portal:~# dpkg -l |grep php | grep memcached<br>
ii php-memcached 3.1.5+2.2.0-10+ubuntu20.04.1+deb.sury.org+3 amd64 memcached extension module for PHP, uses libmemcached<br>
rc php8.0-memcached 3.1.5+2.2.0-10+ubuntu20.04.1+deb.sury.org+3 amd64 memcached extension module for PHP, uses libmemcached<br>
ii php8.1-memcached 3.1.5+2.2.0-10+ubuntu20.04.1+deb.sury.org+3 amd64 memcached extension module for PHP, uses libmemcached</p>
<p dir="auto">So I did:<br>
apt-get install php8.0-memcache and php8.0-memcached</p>
<p dir="auto">Now both composer and artisan commands now seem ok again.</p>
<p dir="auto">So going forward - do people tend to use the distro supplied composer (and have you had the same problem?) or pull an up-to-date one?</p>
<p dir="auto">Any ideas what’s going on with the PHP PPA and why it appears to have half transitioned to PHP 8.1?</p>
<p dir="auto">Thanks,</p>
<p dir="auto">Ian</p>
</div>
</div>
</body>
</html>