Could not find package codeigniter4/framework with stability stable - codeigniter

I'm doing exactly like what is suggested in the official documentation.
composer create-project codeigniter4/framework
However, I'm getting this error instead:
[InvalidArgumentException]
Could not find package codeigniter4/framework with stability stable.
I fully understand it is not stable yet but I'd like to try and develop a simple app for learning purpose since I've been using CI3 all this while. What should I do? This is the closest possible answer to this question but it was left hanging.

You may install develop branch by:
composer create-project codeigniter4/framework:dev-develop

Codeigniter 4 Moved to Production and also updated documentation in Feb 24,2020 you should try this code in composer
composer create-project codeigniter4/appstarter project-root
Check the latest documentation
Codeigniter4 Documentation

It looks like your PHP version is older than required in codeigniter4. please check whether your PHP version is 7.2(or higher) or not. if you're running below 7.2 version of PHP you'll not be able to use codeigniter4.

Check the php version you have installed globally,
using command php -v in cmd,
if it is below 7.2,
edit the php version in environmental variables.
example: D:\wamp64\bin\php\php7.3.12
this solved the issue I was facing while installing ci4 using composer,
have a good day.

Related

Composer version downgrade issue

So I am currently trying to set up an old Laravel project, which requires PHP 7.1. I have successfully downgraded from 8.1 to 7.1, but now the composer issue appears:
I am trying to run composer install on a project, in order to install the dependecies needed, but I am facing the composer version error. After running the suggested command, it basically shows the same error, which does not really make any sense. I have tried other commands but seems like the issue is the same.
I am using MAC.
Any idea?
The message tells you that the current version of Composer installed cannot be run with the current version of PHP installed. Even downgrading is not possible.
To overcome this, you could update PHP again to any supported version (as in: 7.2.5 or later), then downgrade Composer to v2.2, then downgrade PHP again to 7.1.
If you want to ease the switch between PHP versions, you could check for a containerized PHP setup using Docker.

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.5"

I'm trying to upload a plain laravel v5.8 project to a server. It gives me this error
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.5".
I updated the Laravel version to v6 and it still throws the same thing.
Is there any possible solution I tried many but nothing happens. Thanks in advance.
I faced this problem using the new version of composer, didn't have seen this issue before, although this question is a bit old the solution can help someone else.
I did this working in a development machine, if you really need to change the PHP version running in your server this isn't for you.
This problem is related to a composer configuration when you run the command "composer install" if you need to work with the configuration you already have and don't want to make changes which could lead to other problems you should:
remove the packages you already have installed which includes this configuration from composer
sudo rm -r vendor
run the command again with this flag: --ignore-platform-reqs
composer install --ignore-platform-reqs
Now composer won't perform this check anymore and you are good to go!

Cannot update composer dependencies on putty

Good day, I would like to ask some help, had a problem on composer update.
Here is the picture
but when I check using php -v, it says the php version is 7.1.21.
I really don't know what to do.
Try php composer.phar update.
Your "composer" could be an alias and it's probably pointing to a php 7.0 installation. Check using alias composer

Laravel Installer method

Normally I do install Laravel 5.1 by following this command regarding to documentation:
composer create-project laravel/laravel --prefer-dist
It works fine.
But I read in the documentation under "Via Laravel Installer" also it is possible to install via Laravel Installer, which is much faster than installing via Composer:
laravel new blog
But to use this method I need to run following command once:
composer global require "laravel/installer=~1.1"
When I do run it I get following errors many times
Deprecation Notice: Composer\Package\Version\VersionParser::parseLinks
is deprecated. Use \Composer\Package\Loader\ArrayLoader::parseLinks()
instead in
phar://C:/ProgramData/Composer/bin/composer.phar/src/Composer/Package/Version/VersionParser.php:226
after many line of same error ./composer.json has been updated appears and it continues with the same line of errors, it ends with following
Loading composer repositories with package information Updating
dependencies (including require-dev) Nothing to install or update
Generating autoload files
What is wrong with it? Any idea or solution.
My environment: Windows 10, GitBash and cmder console.
Update of composer, I did ran composer self-update also
Snapshot of console
EDIT:
Note, I can confirm after solving the issue that the installation via Laravel Installer method is faster than composer.
The Composer Assets Plugin you've installed locally is using a deprecated method of Composer. The plugin is already fixed, so run composer global update to get the latest versions with the bug fix. After it, you should be able to run the command succesfully.
If this doesn't work (as you might get the same error running the previous command), try removing the global vendor directory. When running any global Composer command, it outputs something like "Changed current directory to XXX". Remove the XXX/vendor directory and then try running the command.
In addition to #WouterJ answer.
Worst case if the steps provided by #WouterJ did not work, you could manage to uninstall and reinstall composer for windows.
When done, run composer global update to be sure to get latest updates, if there was.
Then run composer global require "laravel/installer=~1.1" and it should works.
Remember to update your windows environment path C:\Users\UserName\AppData\Roaming\Composer\vendor\bin

Travis CI build fails for PHP 5.4 while trying to run composer

I am creating an open source project written in PHP and I'm starting to use Travis CI for testing on PHP versions 5.4, 5.5, 5.6 and HHVM.
The tests for 5.5, 5.6 and HHVM pass without any issues, but I get an error on PHP 5.4.
The error is listed here: https://travis-ci.org/CodeRichard/simple-config/jobs/58154496
I noticed it had something to do with the PHPUnit package which I use for local development and pulled in using Composer. This version requires symfony/yaml ~2.1|~3.0. After a bit of googling, I found out the pipe symbol is used as an OR symbol. This bit confuses me a little.
When I read ~2.1|~3.0 I assume it'll try to pull in one and if it fails, the other. I know symfony/yaml 3.* requires PHP 5.5.9, whereas 2.* requires 5.3.9.
What I don't understand is why it fails. Isn't it supposed to pull in symfony/yaml 2.* instead?
Right now, I'm requiring PHPUnit 4.6.* for development. The requirement for PHPUnit is PHP 5.3.3. However, Composer fails when trying Travis CI is trying to test for PHP 5.4. This makes absolutely no sense. If it would crash on PHP 5.4 and PHPUnit 4.6 requires symfony/yaml 3.0, shouldn't the requirement be 5.5?
I know I can just downgrade PHPUnit to 4.5, but I wish to remain up to date, so I'd rather not.
That error message is simple: Composer cannot install a component that got recorded in the composer.lock file, but doesn't match the requirements of THIS PHP:
symfony/yaml 3.0.x-dev requires php >=5.5.9
This will not work with PHP 5.4.
Downgrading your development machine to 5.4 and run composer update again will fix it.
Running composer update instead of composer install in Travis CI will also fix it. If you decide to do this, you should also run Travis with composer update --prefer-lowest to test that your declared minimum versions are correctly working.
You should also try to avoid "minimum-stability":"dev", unless you are really sure that you need bleeding-edge packages. Currently you are using no other packages, so it's not necessary to deal with the issues of unstable dev versions.
Remove composer.lock
This is what I have in my .travis.yml
# ...
before_script:
- rm composer.lock
- composer install --no-interaction --prefer-source
# ...
Issue: #2823

Resources