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
Related
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
We are running a Team Foundation Server (on premises) and as part of a build process it runs composer to install dependancies. Sometime in the last week this process has started failing and I cannot figure out why.
Here is the console output from a failed run:
- Installing symfony/polyfill-ctype (v1.11.0): Downloading (connecting...)Downloading (failed)
Downloading (connecting...)Downloading (failed)
Downloading (connecting...)Downloading (failed) Failed to download symfony/polyfill-ctype from dist: The "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a" file could not be downloaded: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Now trying to download from source
- Installing symfony/polyfill-ctype (v1.11.0): Cloning 82ebae0220
[RuntimeException]
Failed to clone https://github.com/symfony/polyfill-ctype.git via https, ss
h protocols, aborting.
- https://github.com/symfony/polyfill-ctype.git
Cloning into 'D:\agent\_work\3\s\vendor\symfony\polyfill-ctype'...
fatal: unable to access 'https://github.com/symfony/polyfill-ctype.git/':
Failed to connect to github.com port 443: Timed out
- git#github.com:symfony/polyfill-ctype.git
Cloning into 'D:\agent\_work\3\s\vendor\symfony\polyfill-ctype'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Here is part of the output from a successful run about a month ago:
2021-03-25T09:46:09.0972736Z Package operations: 28 installs, 0 updates, 0 removals
2021-03-25T09:46:09.0972880Z - Installing symfony/polyfill-ctype (v1.11.0): Loading from cache
2021-03-25T09:46:09.2716787Z - Installing webmozart/assert (1.4.0): Loading from cache
2021-03-25T09:46:09.5064411Z - Installing phpdocumentor/reflection-common (1.0.1): Loading from cache
2021-03-25T09:46:09.7547542Z - Installing phpdocumentor/type-resolver (0.4.0): Loading from cache
2021-03-25T09:46:10.0682007Z - Installing phpdocumentor/reflection-docblock (4.3.1): Loading from cache
2021-03-25T09:46:10.4608228Z - Installing phpunit/php-token-stream (3.0.1): Loading from cache
The successful run shows it is "loading from cache" rather than going to github. I'm not that experienced with composer so I'm not sure what has gone wrong. No settings on our TFS system have changed to my knowledge.
The server that this runs cannot access github as it is behind a firewall & proxy that block it. But that has always been the case.
Does anyone know why composer would previously have been using a cache and is now trying to access github?
I have been searching the internet for hours for how the composer cache works but haven't been able to find anything that helps.
Many thanks for any help.
Set variable system.debug to true to check the log to see whether you can get more information.
It seems the composer cache is removed on your agent machine recently. You would either make your agent machine access the internet, or install the package manually on the agent machine.
I finally got this issue fixed by getting our corporate proxy updated to allow our build server to access github.
I still do not know how builds were working for so long without issue because to my best knowledge the build server would not have been allowed to access github for at least the last year. I can only assume that either somebody manually setup the Composer cache or the server could, at some time, access github and then the cache just lasted for a very long time.
This was one of those confusing problems where nothing seems to have changed to explain it. However I think something must have changed just a long time ago and the cache was masking it.
Thanks to everyone who helped.
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
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.
I'm trying to setup laravel in my Windows system. I've installed composer. But there are some issues with the composer that is creating problems while trying to create a new laravel project.
I did a composer diagnose from the cmd and following are the results:
composer diagnose
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] The "https://api.github.com/rate_limit" 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
Laravel Error:
new laravel_demo_1
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 59 installs, 0 updates, 0 removals
- Installing doctrine/inflector (v1.1.0): Downloading (failed)
Downloading (failed)
Downloading (failed) Failed to download doctrine/inflector from dist: The "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae" 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.1.0): Cloning 90b2128806 from cache
- Installing erusev/parsedown (1.6.1): Downloading (failed)
Downloading (failed)
Downloading (failed) Failed to download erusev/parsedown from dist: The "https://api.github.com/repos/erusev/parsedown/zipball/20ff8bbb57205368b4b42d094642a3e52dac85fb" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:......
It seems you are simply hitting Github limits due to non authenticated access.
[Composer\Downloader\TransportException] The
"https://api.github.com/rate_limit" file could not be downloaded: SSL
operation failed with code 1. OpenSSL Error messages:
so it should be sufficient to just authenticate yourself:
Log into your GitHub account and click on "Applications" in the sidebar
Create a new token under the "Personal Access Tokens"
in project's folder do:
composer config github-oauth.github.com YOUR-TOKEN
and that should be it.