Is it possible to install the dependencies you have in composer.json file without you have composer as tool in you machine? - composer-php

I'm trying to put this app working but unfortunately whenever I try to install all dependencies inside composer.json file as you can see in the image above I'm getting that error. I don't know what's going on, I don't have composer installed as tool itself for dependency management in PHP. Is it that are causing this error?
*PHP 7.1 is the version of PHP that I'm using.

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!

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

Manually install Parse PHP SDK without Composer

I've got a client on a shared hosting environment (which I can't change) and I'm needing to install the Parse PHP SDK, but the host won't allow me to install the Composer package manager. Does anyone else know of a manual install method?
If you have wget/unzip available, just download latest release zip (bellow the release, this file).
Use unzip to unpack package and load it with PSR-4 autoloading (the composer's approach).
Composer isn't meant to be an installer, so you are not expected to run Composer on the production machine. What would happen if during your update process Github would be down? No new website version! And maybe also no old version.
Run Composer somewhere else, and then upload the result to the server, after you verified that everything went well.

Using Laravel "Warning:require(C:\wamp\www\laravel\bootstrap/../vendor/autoload.php): failed to open stream: No such

I am new to laravel, composer, and windows terminal. I am trying to setup laravel on my local host. I currently have wamp installed and I have used it before to create basic websites. However, I am now doing a bigger project that needs a framework so I decided to learn Laravel. I installed composer as indicated in the directions, but when i run the command
"C:\wamp\www>composer create-project laravel/laravel laravel"
i generate an error message that says
"[InvalidArgumentException] Project directory laravel/ is not empty."
When I open a browser and navigate to "localhost/laravel/public" I encounter the error message from the title of this thread:
"Warning:require(C:\wamp\www\laravel\bootstrap/../vendor/autoload.php): failed to open stream: No such
I have also added the appropriate environment variables from the composer instructions.
I am really lost at this point, and I have spent the past 4 hours trying to debug this.
I am running Windows 8 x64.
Edit:
I tried running composer install in C:\wamp\www and received an error message
Composer could not find the config file:
C:\ProgramData]ComposerSetup\bin Ti initialize a project, please
create a composer.json file as described in the
http://getcomposer.org/ "Getting Started" section "
The dependencies for your project are not installed. Just download composer from GetComposer.org and install it on your Windows Machine. Then navigate to your project root, you will see a composer.json file there. That file specifies all the dependencies of the project. Run composer update in that directory. Composer will then update or install all required dependencies and your application won't show the error then.
cd \wamp\www\yourproject
composer update
"C:\wamp\www>composer create-project laravel/laravel laravel"
"[InvalidArgumentException] Project directory laravel/ is not empty."
This means C:\wamp\www\laravel already existed when you attempted to run the command. Remove the folder, or change the create-project command to use a different folder name for your new project.
"Warning:require(C:\wamp\www\laravel\bootstrap/../vendor/autoload.php): failed to open stream: No such
You need to do a composer install from C:\wamp\www\laravel.
I figured it out! I was missing a folder called "vendor" and a file inside bootstrap called "compiled.php" Sorry for the inconvenience, and thank you for trying!
use the following command to get vendor folder in your project
composer install --no-scripts
i had the same problem but i just ran this command
composer install
to install all the dependencies

Resources