Fatal error with composer in a new installation of codeigniter 4 - composer-php

I am trying to install CodeIgniter 4.3.1 on a shared Linus server using composer.
Two different versions of composer are installed (by the hosting company) on that server.
-bash-4.2$ composer2 --version Composer version 2.0.12
-bash-4.2$ composer --version Composer version 1.10.21
The installation is done using compose2 without any problem
(composer create-project codeigniter4/appstarter myAppName)
When I try to run the site I encounter the following message.
Fatal error: Uncaught RuntimeException: Your Composer version is too old. Please update Composer (run composer self-update) to v2.0.14 or later and remove your vendor/ directory,
and run composer update. in /home/..../vendor/codeigniter4/framework/system/Autoloader/Autoloader.php:377
Stack trace: #0 /home/..../vendor/codeigniter4/framework/system/Autoloader/Autoloader.php(143):
CodeIgniter\Autoloader\Autoloader->loadComposerNamespaces()
#1 /home/..../vendor/codeigniter4/framework/system/Autoloader/Autoloader.php(125): CodeIgniter\Autoloader\Autoloader->loadComposerInfo()
#2 /home/.../vendor/codeigniter4/framework/system/bootstrap.php(105): CodeIgniter\Autoloader\Autoloader->initialize()
#3 /home/..../public/index.php(38): require('/home/u86872913...')
#4 {main} thrown in /home/.../vendor/codeigniter4/framework/system/Autoloader/Autoloader.php on line 377
I can't run `composer self-update' because I don't have read/write permissions to this area.
I tried to install (composer install --working-dir=/home/..../vendor ) in the ci4 vendor path, but the message remain.
Even if i run php composer.phar --version in that directory i get Composer version 2.5.3.
I did not found where composer path is defined in ci4 ( COMPOSER_PATH => /vendor/autoload.php )
Or how can i point ci4 to the correct installation.
Any help will be appreciated.

Related

Composer always fails to install symfony/var-dumper

I'm trying to install the latest version of Laravel 8 on the latest version of Homestead. When I run composer install or composer update, installation of symfony/var-dumper always fails:
Installing symfony/var-dumper (v5.2.6): Extracting archive
Install of symfony/var-dumper failed
[ErrorException]
file_get_contents(/home/vagrant/code/vendor/symfony/var-dumper/Resources/bin/var-dump-server):
Failed to open stream: No such file or directory
Despite the error exception, the file /vendor/symfony/var-dumper/Resources/bin/var-dump-server does exist.
Things I've tried:
Deleting the lock file and re-running composer update
Manually specifying specific versions of var-dumper, e.g. composer require symfony/var-dumper:5.2.0
I always get the same errors.
Remove /vendor folder, then run:
composer update -v
This turned out to be a compatibility issue with Composer 2.x. I downgraded to the 1.x channel using composer self-update --1, then ran composer install again, and the installation succeeded.
Composer version 2.2.4 2022-01-08 12:30:42
and
symfony/var-dumper v5.4.3
is working just fine

how to install illuminate/mail via composer in Lumen

A setting mail-in on lumen project, I should install illuminate\mail via composer, but show me an error:
Your requirements could not be resolved to an installable set of packages
You can install through composer using the following command in the terminal:
composer require illuminate/mail
Make sure you are in the project directory.

ORO-CRM Composer Install - Failed to download composer/composer

For Install OroCRM in windows i have followed -> https://stackoverflow.com/a/40929643/8416476 after successful the command git clone -b 1.9.0 https://github.com/orocrm/platform-application.git orocrm then i try to run composer install --prefer-dist --no-dev Here i am getting error.
Installing composer/composer (1.0.0-p1): Downloading (failed) Failed to download composer/composer from dist: The
"https://api.github.com/repos/orocrm/composer/zipball/833ce984264204e7d6576ab082660105c7d8f04c"
file could not be downloaded (HTTP/1.1 404 Not Found)
How can i solve the issue.
Note : OroCRM in Windows
Install composer globally using https://getcomposer.org/Composer-Setup.exe
Then just run composer install --prefer-dist --no-dev from within application folder. This error is very odd and why are you trying to download 1.9.0 version? It is copy paste error or you specifically need this one?
Try Linux platform with Xampp for better convenient. refer https://oroinc.com/orocrm/doc/current/system-requirements#system-requirements

composer: package can not be found on each environment

I was trying to install a composer package for Magento2 using composer require magestore/storelocator-magento2. In my local Vagrant box as well on my laptop the package could be found and was installed, whereas on a dev-server the same package could not be found.
My question is, which differences in the system setup or composer setup could be the reason, that an existing package cannot be found?
The composer.json and thus the stability settings are identical in all environments.
# machine 1
$ composer --version
Composer version 1.6.3 2018-01-31 16:28:17
$ composer require magestore/storelocator-magento2
Using version ^1.0 for magestore/storelocator-magento2
# machine 2
$ composer --version
Composer version 1.6.3 2018-01-31 16:28:17
$ composer require magestore/storelocator-magento2
[InvalidArgumentException]
Could not find a matching version of package magestore/storelocator-magento2.

Composer doesn't run in presence of composer.json

I installed composer globally on my Debian server
~$ which composer
/usr/local/bin/composer
It works, gets updated and I used it for three different (Symfony) sites.
~$ composer self-update
You are already using composer version 1.3.3 (stable channel).
However, when I am in the directory of one of the sites, and try to update all dependencies, I get an error (before, this just worked and updated the vendors etc).
~/website-path$ ls composer.*
composer.json composer.lock
~/website-path$ composer update
[ErrorException]
Illegal string offset 'version'
~/website-path$ composer
[ErrorException]
Illegal string offset 'version'
When I rename composer.json, this Error disappears (but the lack of .json file makes this quite useless)
What went wrong here and how can I fix this?
The problem magically went away overnight by upgrading to 1.4.0
~$ composer -V
Composer version 1.4.0 2017-03-08 17:51:24
~/website-path$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
[...]

Resources