Unable to use composer on windows 10 - php

I've installed composer via the exe available on the composer website but when I run «composer install» on my freshly cloned repo, I got this error:
composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 84 installs, 0 updates, 0 removals
Installing ocramius/package-versions (1.2.0): Downloading (100%)
Downloading (100%)
Downloading (100%) Failed to download ocramius/package-versions from dist: The "https://codeload.github.com/Ocramius/PackageVersions/legacy.zip/ad8a245decad4897cc6b432743913dad0d69753c" file could not be written to C:\Users\littl\Documents\PhpStorm\interrogator\vendor/ocramius/package-versions/033201643b71b6e284b58c9a7b0d8905: failed to open stream: Permission denied
Now trying to download from source
Installing ocramius/package-versions (1.2.0): Cloning ad8a245dec from cache
[RuntimeException]
Failed to clone https://github.com/Ocramius/PackageVersions.git via https, ssh protocols, aborting.
https://github.com/Ocramius/PackageVersions.git
fatal: destination path 'C:\Users\littl\Documents\PhpStorm\interrogator\vendor\ocramius\package-versions' already
exists and is not an empty directory.
git#github.com:Ocramius/PackageVersions.git
fatal: destination path 'C:\Users\littl\Documents\PhpStorm\interrogator\vendor\ocramius\package-versions' already
exists and is not an empty directory.
I've tried to use composer.phar instead but same issue.
Of course, I've totally removed the vendor directory and started again, same issue.
I've also noticed the «file could not be written» error, but I'm running composer with an Admin account on Win 10 and composer is able to create vendor directory by itself, so it should be good.
What can be the issue ?

destination path 'C:\Users\littl\Documents\PhpStorm\interrogator\vendor\ocramius\package-versions' already exists and is not an empty directory.
Fix this manually.

Related

yii2 is not loaded via the composer

You need to install the project, follow the instructions, docker-compose up is successfully completed, however, when executing the docker-compose exec php composer install -o --prefer-dist command, the following message appears:
Loading composer repositories with package information
Installing dependencies (including require-dev) from the lock file
Package operations: 244 installations, 0 updates, 0 deletions
- Installation of yiisoft/yii2-composer (2.0.8): Download (failed)
Download (failed)
Download (failed) Failed to load yiisoft/yii2-composer from disk: "https://api.github.com/repos/yiisoft/yii2-composer/zipball/5c7ca9836cf80b34db265332a7f2f8438eb469b9 " file failed to load: stream failed to open: connection timeout expired
Now I'm trying to download from the source code
I assume that there is a problem with network access, but I do not understand what is the matter
os - ubuntu
environment - phpstorm

Why I can't create laravel projects anymore?

I am working on a local server on my windows os,
I used to be able to create new laravel projects normally, but now I keep getting errors like these:
C:\xampp\htdocs>laravel new blog
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 70 installs, 0 updates, 0 removals
- Installing doctrine/inflector (v1.3.0): Downloading (failed)
Downloading (failed)
Downloading (failed) Failed to download doctrine/inflector from dist: The "https://api.github.com/repos/doctrine/inflector/zipball/5527a48b7313d15261292c149e55e26eae771b0a" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Now trying to download from source
- Installing doctrine/inflector (v1.3.0): Cloning 5527a48b73 from cache
sure your internet connection not have problem in speed
so check your firewall not blocked api.github.com url

PHP project installation using composer showing error in windows 10

I try to install https://github.com/IntuitDeveloper/OAuth2.0-demo-php using composer as per instructed guideline in the readme file. But when I type composer install it shows following error.
Loading composer repositories with package information Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing quickbooks/v3-php-sdk (v5.0.1): Downloading (100%)
[ErrorException]
copy(C:/Users/akarim/AppData/Local/Composer/files/quickbooks/v3-php-sdk/1efd4237b15cab6ba43b7b099a7772238016b31b.zip): failed to open stream: Permission denied
How can I solve this? Thanks in advance.
You need to give 755 permission to that file
C:/Users/akarim/AppData/Local/Composer/files/quickbooks/v3-php-sdk/1efd4237b15cab6ba43b7b099a7772238016b31b.zip

Symfony install missing vendors libraries

I have a fresh install of Symfony with everthing looking in-place apart from my vendors directory is empty? That is, it has
composer and doctrine directories in it but they are empty. If I stand in my root and run the command:
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing doctrine/lexer (v1.0.1)
Downloading: 100%
Failed to download doctrine/lexer from dist: Could not decompress the archive, enable the PHP zip extension.
The php.ini used by your command-line PHP is: /etc/php5/php.ini
Now trying to download from source
- Installing doctrine/lexer (v1.0.1)
Cloning 83893c552fd2045dd78aef794c31e694c37c0b8c
[RuntimeException]
Failed to clone git#github.com:doctrine/lexer.git via git, https, ssh protocols, aborting.
- git://github.com/doctrine/lexer.git
Cloning into '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer'...
fatal: remote composer already exists.
- https://github.com/doctrine/lexer.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer' already exists and is not an empty directory.
- git#github.com:doctrine/lexer.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer' already exists and is not an empty directory.
At the front end browsing to http://symfony.local/web/
Warning: require(C:\Apache24\htdocs\symfony.local\app/../vendor/autoload.php): failed to open stream: No such file or directory in C:\Apache24\htdocs\symfony.local\app\autoload.php on line 11
Fatal error: require(): Failed opening required 'C:\Apache24\htdocs\symfony.local\app/../vendor/autoload.php' (include_path='.;c:\php\includes') in C:\Apache24\htdocs\symfony.local\app\autoload.php on line 11
Clearly it's looking for /vendor/autoload.php but this isn't there. Why is my vendor directory empty and how can I ensure the libraries get installed?
$ composer update returns:
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing paragonie/random_compat (1.1.4)
Downloading: 100%
Failed to download paragonie/random_compat from dist: Could not decompress the archive, enable the PHP zip extension.
The php.ini used by your command-line PHP is: /etc/php5/php.ini
Now trying to download from source
- Installing paragonie/random_compat (1.1.4)
Cloning d762ee5b099a29044603cd4649851e81aa66cb47
[RuntimeException]
Failed to clone git#github.com:paragonie/random_compat.git via git, https, ssh protocols, aborting.
- git://github.com/paragonie/random_compat.git
Cloning into '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat'...
fatal: remote composer already exists.
- https://github.com/paragonie/random_compat.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat' already exists and is not an empty directory.
- git#github.com:paragonie/random_compat.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat' already exists and is not an empty directory.
Well, your PHP is not properly configured.
Adjust your /etc/php5/php.ini and enable the "ZIP" extension.
And the rest is probably a permissions issue, because you are using Cygwin in combination with Composer. Composer and Cygwin are not really best friends.
My suggestion: run Composer on the native Windows CLI, just for the vendor fetching part.
What you want is composer update. It will read your composer.json to install all required packages. composer install is used for deployment.
Download and enable the zip extention for PHP
If you are using PHP7.0 and use a debian base distribution (Ex: Ubuntu), use the following to install and enable it automaticaly
apt-get install php-zip

Error when installing Lumen framework with Composer

When I run
sudo composer global require "laravel/lumen-installer=~1.0"
I get an error (below) that says it failed to download elfet/php-ssh.
Changed current directory to /Users/chad/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing elfet/php-ssh (v1.1.0)
Downloading: Connecting... Failed to download elfet/php-ssh from dist: The "https://api.github.com/repos/elfet/php-ssh/zipball/439becf180272542cbf154df4856a49dd3c4bf04" file could not be downloaded (HTTP/1.1 404 Not Found)
Now trying to download from source
I am meeting all the server requirements too. Any ideas why it's failing to install?
It is a elfet/php-ssh package not found issue and it was resolved
Refer: https://github.com/deployphp/deployer/issues/158
Or you can install lumen via composer create-project and refer the following link has good tutorial about install lumen and create a simple rest api.
link: http://wsnippets.com/create-rest-api-using-lumen-micro-framework-by-laravel/

Categories