Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mbo's avatar
Level 3

Error after updating composer

Good day,

I have updated my composer. Ending up in error. This what i did and what happend.

Thank you very much for the help!

Maartens-MacBook-Pro:lig mbo$ composer update

Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 3 installs, 61 updates, 1 removal
  - Removing phpunit/phpunit-mock-objects (5.0.10)
  - Updating composer/installers (v1.7.0 => v1.8.0): Downloading (100%)
  - Updating doctrine/event-manager (v1.0.0 => 1.1.0): Downloading (100%)
  - Updating doctrine/cache (v1.8.0 => 1.10.0): Downloading (100%)
  - Updating doctrine/dbal (v2.9.2 => v2.10.1): Downloading (100%)
  - Updating fzaninotto/faker (v1.8.0 => v1.9.1): Downloading (100%)
  - Updating sebastian/resource-operations (1.0.0 => 2.0.1): Downloading (100%)
  - Updating sebastian/exporter (3.1.1 => 3.1.2): Downloading (100%)
  - Updating sebastian/environment (3.1.0 => 4.2.3): Downloading (100%)
  - Updating sebastian/diff (2.0.1 => 3.0.2): Downloading (100%)
  - Updating sebastian/comparator (2.1.3 => 3.0.2): Downloading (100%)
  - Updating phpunit/php-timer (1.0.9 => 2.1.2): Downloading (100%)
  - Updating phpunit/php-file-iterator (1.4.5 => 2.0.2): Downloading (100%)
  - Updating phpunit/php-token-stream (2.0.2 => 3.1.1): Downloading (100%)
  - Updating phpunit/php-code-coverage (5.3.2 => 6.1.4): Downloading (100%)
  - Updating symfony/polyfill-ctype (v1.12.0 => v1.14.0): Downloading (100%)
  - Updating webmozart/assert (1.4.0 => 1.7.0): Downloading (100%)
  - Updating phpdocumentor/reflection-common (1.0.1 => 2.0.0): Downloading (100%)
  - Updating phpdocumentor/type-resolver (0.4.0 => 1.1.0): Downloading (100%)
  - Updating doctrine/instantiator (1.2.0 => 1.3.0): Downloading (100%)
  - Updating phpdocumentor/reflection-docblock (4.3.1 => 5.1.0): Downloading (100%)
  - Updating phpspec/prophecy (1.8.1 => v1.10.3): Downloading (100%)
  - Updating phar-io/version (1.0.1 => 2.0.1): Downloading (100%)
  - Updating phar-io/manifest (1.0.1 => 1.0.3): Downloading (100%)
  - Updating myclabs/deep-copy (1.9.3 => 1.9.5): Downloading (100%)
  - Updating phpunit/phpunit (6.5.14 => 7.5.20): Downloading (100%)
  - Updating psr/log (1.1.0 => 1.1.3): Downloading (100%)
  - Updating filp/whoops (2.5.0 => 2.7.1): Downloading (100%)
  - Updating symfony/finder (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating doctrine/inflector (v1.3.0 => 1.3.1): Downloading (100%)
  - Updating erusev/parsedown (1.7.3 => 1.7.4): Downloading (100%)
  - Updating league/flysystem (1.0.53 => 1.0.66): Downloading (100%)
  - Updating monolog/monolog (1.24.0 => 1.25.3): Downloading (100%)
  - Updating mtdowling/cron-expression (v1.2.1 => v1.2.3): Downloading (100%)
  - Updating symfony/translation-contracts (v1.1.5 => v1.1.7): Downloading (100%)
  - Updating symfony/polyfill-mbstring (v1.12.0 => v1.14.0): Downloading (100%)
  - Updating symfony/translation (v4.3.3 => v4.3.11): Downloading (100%)
  - Updating nesbot/carbon (1.39.0 => 1.39.1): Downloading (100%)
  - Updating ramsey/uuid (3.8.0 => 3.9.3): Downloading (100%)
  - Updating symfony/polyfill-php72 (v1.12.0 => v1.14.0): Downloading (100%)
  - Updating symfony/polyfill-intl-idn (v1.12.0 => v1.14.0): Downloading (100%)
  - Updating symfony/polyfill-iconv (v1.12.0 => v1.14.0): Downloading (100%)
  - Updating doctrine/lexer (1.1.0 => 1.2.0): Downloading (100%)
  - Updating egulias/email-validator (2.1.11 => 2.1.17): Downloading (100%)
  - Updating swiftmailer/swiftmailer (v6.2.1 => v6.2.3): Downloading (100%)
  - Installing symfony/polyfill-util (v1.14.0): Downloading (100%)
  - Installing symfony/polyfill-php56 (v1.14.0): Downloading (100%)
  - Updating symfony/debug (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating symfony/polyfill-php70 (v1.12.0 => v1.14.0): Downloading (100%)
  - Updating symfony/http-foundation (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating symfony/event-dispatcher-contracts (v1.1.5 => v1.1.7): Downloading (100%)
  - Updating symfony/event-dispatcher (v4.3.3 => v4.4.5): Downloading (100%)
  - Updating symfony/http-kernel (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating symfony/process (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating symfony/routing (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating tijsverkoyen/css-to-inline-styles (2.2.1 => 2.2.2): Downloading (100%)
  - Removing dnoegel/php-xdg-base-dir (0.1)
  - Installing dnoegel/php-xdg-base-dir (v0.1.1): Downloading (100%)
  - Updating nikic/php-parser (v4.2.3 => v4.3.0): Downloading (100%)
  - Updating symfony/var-dumper (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating symfony/console (v3.4.30 => v3.4.38): Downloading (100%)

Till here everything like to work normaly.

Here he asked for the token key. I got it from github

  - Updating psy/psysh (v0.9.9 => v0.9.12): Downloading (0%)GitHub API limit (0 calls/hr) is exhausted, could not fetch https://api.github.com/repos/bobthecow/psysh/zipball/xxxxxxxxxxxxxxxx. Create a GitHub OAuth token to go over the API rate limit. You can also wait until ? for the rate limit to reset.

Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+xxxxxx-MacBook-Pro.localxxxxxxxxxxxx

to retrieve a token. It will be stored in "/Users/xxxxxx/.composer/auth.json" for future use by Composer.

I think i pasted the token 2 times. Causing the password to be wrong.

Token (hidden):
    Update failed (The 'https://api.github.com/' URL could not be accessed: HTTP/1.0 400 Bad Request
)

he asked to reinstall the package again. I said no.

    Would you like to try reinstalling the package instead [yes]? no

i got this error

  [Composer\Downloader\TransportException]
  The 'https://api.github.com/' URL could not be accessed: HTTP/1.0 400 Bad Request

ending up in this.

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

Maartens-MacBook-Pro:ligplaats mbolivier$ composer update

But if i now load my page i get the following error:


Warning: require(/Users/mbo/Applications/lig/vendor/composer/../psy/psysh/src/functions.php): failed to open stream: No such file or directory in /Users/mbo/Applications/lig/vendor/composer/autoload_real.php on line 66

Fatal error: require(): Failed opening required '/Users/mbolivier/Applications/lig/vendor/composer/../psy/psysh/src/functions.php' (include_path='.:/usr/local/Cellar/php/7.3.8/share/php/pear') in /Users/mbo/Applications/lig/vendor/composer/autoload_real.php on line 66

I have really no idea what is causing the error. How can i solve this?

Thanks in advance!

br

maarten

0 likes
5 replies
Snapey's avatar
Snapey
Best Answer
Level 122

The error is

Create a GitHub OAuth token to go over the API rate limit. You can also wait until ? for the rate limit to reset.

You need to create an account on github and get a new Personal Access Token

https://github.com/settings/tokens/new

Select the checkbox next to repo

generate the token, and copy it

run

composer config -g github-oauth.github.com XXXXXXXXXXXXXXXXXXXXXXX

where xxxxx is your token

(the rate limit also resets every hour, so it may just work without doing this now, but its a good practice to do this whilst you have the issue and can prove that it has taken effect)

mbo's avatar
Level 3

Snapey,

thanks for your reply! I did what you mentioned.

by running it i didn't get any reaction. Although gitup directly sended an email.

On March 26th, 2020 at 09:33 (UTC) your personal access token (Composer on Maartens-MacBook-Pro.local 2020-03-25 1408) using Composer/1.9.0 (Darwin; 18.7.0; PHP 7.3.8) was used as part of a query parameter to access an endpoint through the GitHub API:

https://api.github.com/repositories/15428480/zipball/xxxxxxxxxxxxxxxxxxxxxx

Please use the Authorization HTTP header instead, as using the `access_token` query parameter is deprecated. If this token is being used by an app you don't have control over, be aware that it may stop working as a result of this deprecation.

Depending on your API usage, we'll be sending you this email reminder on a monthly basis for each token and User-Agent used in API calls made on your behalf.
Just one URL that was accessed with a token and User-Agent combination will be listed in the email reminder, not all.

Visit https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param for more information about suggested workarounds and removal dates.

Thanks,
The GitHub Team


any idea what they mean with this?

secondly the error is still present.


Warning: require(/Users/mbo/Applications/lig/vendor/composer/../psy/psysh/src/functions.php): failed to open stream: No such file or directory in /Users/mbo/Applications/lig/vendor/composer/autoload_real.php on line 66

Fatal error: require(): Failed opening required '/Users/mbolivier/Applications/lig/vendor/composer/../psy/psysh/src/functions.php' (include_path='.:/usr/local/Cellar/php/7.3.8/share/php/pear') in /Users/mbo/Applications/lig/vendor/composer/autoload_real.php on line 66


Any idea how to solve this?

thanks in advance!

mbo's avatar
Level 3

Snapey,

thanks for the help. I solved it by re running composer update. By following your step it went well. autoload files were created.

thanks again.

Snapey's avatar

Looks like my information is a little out of date.

For anyone else that comes across this, the bottom line is that Github will rate limit your access to repos unless you identify yourself.

Please or to participate in this conversation.