I installed phpbrew to use php 5.4 in Ubuntu 14.04. It works fine, except when I try to use composer, which ignores phpbrew and installs dependencies related to php 5.5.
Is there a way to force composer to be compatible with phpbrew config?
I trying to add: php: "5.4" in my composer.json, but it says that this requirement is not possible with my php version.
You can easy install composer with phpbrew by following command:
$ phpbrew app get composer
Source: https://github.com/phpbrew/phpbrew Section: Installing Extra Apps
I was getting an error as app is not a valid command. To fix this, I used brew install composer.
Related
Facing issue after downgrade the PHP version with updated version of composer,
I am trying to doing upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2 which option is given by CMD.
I tried myself with downgrade the PHP version using the Command of brew but I tried to get the solution for composer, Either it's possible to downgrade or upgrade the version of composer same like PHP.
I am trying to make an import excel data to mysql using php and trying to install composer require phpoffice/phpspreadsheet
but the error below always appear.
Installation failed, deleting ./composer.json.
In RequireCommand.php line 217:
No composer.json present in the current directory (./composer.json), this may be the cause of the following exception.
In PackageDiscoveryTrait.php line 313:
Package phpoffice/phpspreadsheet has requirements incompatible with your PHP version, PHP extensions and Composer version:
- phpoffice/phpspreadsheet 1.25.2 requires ext-zip * but it is not present.
At First, I thought i was because of my php version. I am running xampp with php 7.3 on my macOs. it didnt work.
I try to install it in my windows PC which run php 7.4 and it work just fine.
So I remove my 7.3 version and install the 7.4 version into my mac. and it didnt work either.
There is no compomposer.json in the directory.
When starting a new project, you should at first run
composer init
It will do some question to initialize the value in composer.json, which basically are the same you can pass as parameter to the command: https://getcomposer.org/doc/03-cli.md#init
After that you can run composer to install package
avoid using same name in folder and before installation use composer init
After running sudo apt-get update && sudo apt-get dist-upgrade on my Laravel app, I'm getting this error on the next deployment:
- This package requires php ^7.1.3 but your PHP version (8.1.6) does not satisfy that requirement.
In my composer.json, ^7.1.3 is the specified version. This is my first time running the apt-get update and I don't know why the php version got updated as well.
On each deployment I run
composer install --no-interaction --prefer-dist --optimize-autoloader
How can I downgrade the version to 7.1.3? This happens on an existing app in production and I have to be very careful about it.
The php version installed on your environment should be compatible with your project.
If your project is based on composer package manager (as I see), it can help you to control which php version you need on the server.
In your case I would recommend to restore from the snapshot or just install php 7.1.3 version back.
If you want to use php 7.4/8/8.1 in your project, before you should upgrade your code and project dependencies and ensure, that everything working fine with the desired version of php.
Old topic, but for things like this, I recommend adding the flag to ignore requirements like this. So try:
composer install --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-reqs
There may be incompatibilities with your project using 8.1 instead of 7.1.3, but I doubt it. But still, only do this if you feel confident the PHP version won't be an issue. It's usually better than downgrading, however.
I'm using the following composer version, composer -V
Composer version #package_branch_alias_version# (1.0.0-beta2) 2016-03-27 16:00:34
I tried to do a "composer install" and I get the following error.
Drupal-project requires Composer version 1.0.0 or higher. Please update your Composer before continuing.
I don't know what should be checked differently on this project to be able to use a development version of composer.
I'd suggest uninstalling composer and re-installing the proper version:
second reply explains it pretty well, use the official documentation to re-install
Why am I unable to self-update composer?
Upgrade your system to Ubuntu 18.04 (bionic), where the Composer version is >= 1.0.0.
I want to run composer on my shared hosting. When I install it, I have php version problem. It needs minumum version of 5.5. Then, my version seems 5.4. To solve it, I can siwtch it on Cpanel; however, there is no change from command line.
As a result, I don't have root privilege and I should switch php version from 5.4 to 5.5. What I should do to install composer?
I solved the problem. Composer will be installed with this command smoothly:
php [your composer.phar path] --install-dir