I'm installing Valet on my MacBook Pro - El Capitan.
I installed PHP and MySQL with Homebrew as suggested on the Valet documentation page.
However, when I try to install Valet, I get the error:
PHP Fatal error: Cannot redeclare resolve() (previously declared in /Users/marc/.composer/vendor/hoa/core/Protocol.php:1140) in /Users/marc/.composer/vendor/laravel/valet/cli/includes/helpers.php on line 57
Fatal error: Cannot redeclare resolve() (previously declared in /Users/marc/.composer/vendor/hoa/core/Protocol.php:1140) in /Users/marc/.composer/vendor/laravel/valet/cli/includes/helpers.php on line 57
My composer.json file looks like this:
{
"require": {
"phpunit/phpunit": "~4.2",
"phpmetrics/phpmetrics": "^1.10",
"laravel/valet": "^1.1"
}
}
I have tried deleting composer.lock and deleted the vendor directory, then composer install, but nothing changes. Any one have any advice here?
I ran into this recently and I was able to resolve it by uninstalling / reinstalling valet:
composer global remove laravel/valet
then
composer global require laravel/valet
Basically there are 2 methods called the same thing, one in
/Users/marc/.composer/vendor/hoa/core/Protocol.php line 1140
and the other in /Users/marc/.composer/vendor/laravel/valet/cli/includes/helpers.php on line 57.
A quick fix would be to remove the phpmetrics/phpmetrics dependency and run composer install again
Good thing is that in both places they check if the function exists, so you can declare it yourself.
If declare your own version before the vendor/autoload.php file is loaded, if you have control over this. So you could declare it to do what it currently does in Laravels helpers.php
I see you solved your issue, but for posterity:
You may have ran: composer global require "laravel/laravel"
Then ran: composer global require "laravel/installer"
Run: composer global remove "laravel/laravel" to get rid of the duplication.
Related
I'm trying to use the following library, this.
It all seems pretty use but doesn't seem to work for me. I've added the stuff the the composer.json and I also updated the app.php. Then I ran composer dump-autoload in the laravel directory.
I still seem to be getting the same error..
FatalErrorException in ProviderRepository.php line 146:
Class 'Invisnik\LaravelSteamAuth\SteamServiceProvider' not found
Try to install this package by this command:
composer require invisnik/laravel-steam-auth
You will install the latest version of current package and update your composer.json, composer.lock and autoload files.
In trying to get Laravel Valet up and running, I have stumbled upon this issue. When running 'valet install' or 'valet park' or any valet-command at all, I get the following error:
> PHP Fatal error: Cannot redeclare info() (previously declared in /Users/jantore/.composer/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:454) in /Users/jantore/.composer/vendor/laravel/valet/cli/includes/helpers.php on line 20
>
> Fatal error: Cannot redeclare info() (previously declared in
> /Users/jantore/.composer/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:454)
> in
> /Users/jantore/.composer/vendor/laravel/valet/cli/includes/helpers.php
> on line 20 eger:~ jantore$
I went through the helpers.php document and tried to comment out the info()-function, but that didn't make a difference.
I have a fresh Brew install with PHP 7.0 as per the Valet-install instructions.
Anyone have any clue what this might be?
Update: As per Ben Swinbourne's suggestion I tried with composer global dump-autoload. Unfortunately the same result, no change in the error. Thanx to Ben for the suggestion though :)
I know this is an old topic, I recently had a similar issue, except mine was around the retry() function.
to solve it.
composer global remove laravel/valet
composer global require laravel/valet
This might help you, try deleting the composer.lock file and the vendor directory and then do a composer update.
After upgrading from Symfony 2.3 to 2.8 I get the following error:
Fatal error: Interface
'Symfony\Component\HttpKernel\HttpKernelInterface' not found in
app/bootstrap.php.cache on line 2629
Already tried removing the vendor folder and doing a composer install.
Any ideas?
Have you tried removing cached code? It seems like you've procompiled your application into one file bootstrap.php.cache. Have you tried removing it.
Otherwise it is always a good idea to do two of the following commands:
php composer.phar dump-autoload - update autolod file
php app/console cache:clear - removes cache
I had to add the following line to web/app.php and web/app_dev.php:
$loader = require __DIR__.'/../app/autoload.php';
And also update app/console.
Found this by comparing my files with a fresh install of Symfony 2.8
I just up updated composer.phar in my local environment.
Now, I get an error that says
Fatal error: Class 'phpseclib\Crypt\AES' not found in /var/www/html/tms2/fuel/core/classes/crypt.php on line 213
How can I fix this?
Do you use 1.8/develop?
Recently it has switched to the composer version.
https://github.com/fuel/fuel/commit/87c1a6feb5deaff63dfa2cb561035ea6c51b724b
Check your composer.json and update it, then do composer update again.
Me and my coworker are trying to use local git repo for our Laravel project.
I am using Ubuntu, with PHP 5.5.9-1ubuntu4.9, and he is using Debian with PHP 5.4.39.
When I pulled his committed version, I get an error when trying to run composer update:
user#ubuntu:/var/www/frontend$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
PHP Fatal error: Class 'Illuminate\Support\Arr' not found in /var/www/frontend/vendor/laravel/framework/src/Illuminate/Support/helpers.php on line 182
Script php artisan clear-compiled handling the post-install-cmd event returned with an error [RuntimeException]
Error Output: PHP Fatal error: Class 'Illuminate\Support\Arr' not found in /var/www/frontend/vendor/laravel/framework/src/Illuminate/Support/helpers.php on line 182
We have vendor folder on git, since not having it isn't an option for us.
I guess the problem is different php versions. Is there a way of setting up php version manually, so composer gets the right dependencies?
you can set php version in composer.json file in require portion
"require": {
"php": ">=5.3.0",
},
The problem was probably this:
User checked in the project, including the vendor folder.
Later vendor somehow got added to .gitignore
Nobody noticed that new files were not being added to the repo and magic made sure everything still worked as it did :D