Composer error installing laravel-cors - laravel-5

I tried to install laravel-cors
composer require barryvdh/laravel-cors
It installed successfully or so I thought, but then when I went to publish the config I get this error:
[RuntimeException]
Error Output: PHP Fatal error: Cannot redeclare Composer\Autoload\includeFile() (previously declared in /www/vendor/composer/ClassLoader.php:410) in /www/config/vendor/composer/ClassLoader.php on line 413
I have tried removing laravel-cors and I still get this error. I have dumped autoload as well. What am I missing?
Larval 5.2 | PHP 5.6.17

I figured it out. When i typed
composer require barryvdh/laravel-cors
i was in a sub directory. so composer then installed it and the dependencies in a sub directory which is why i was getting that error. If you look closely you can see that it was installing in config
/www/config/vendor/composer/ClassLoader.php:413
/www/vendor/composer/ClassLoader.php:410
Just needed to pay better attention to detail.

Related

"Class 'ConsoleTVs\Charts\Facades\Charts' not found"

Please note that, I'm using rappasoft updated boilerplate Laravel 5.8 and I'm using your installation steps but it's giving me this error message:
Class 'ConsoleTVs\Charts\Charts' not found
they forgot to add install charts dependency through composer try this
composer require consoletvs/charts
this will install your missing dependency

Cloudstack client installation

I have XAMPP installed on Windows 10. And have successfully installed Composer, Laravel. I can see the basic Laravel project page on my local server.
Just to try things out I also installed yii2. I can see the basic yii2 page also on my local server.
Now I'm trying to install this Generic Cloudstack Client:
https://github.com/PCextreme/cloudstack-client
In XAMPP, under htdocs I have this dir called 'LaravelProjects'.
dir structure
First I made the project with the laravel command:
laravel new PCextreme
Then in PCextreme directory I give the command:
composer require pcextreme/cloudstack-client:~0.1
The composer breaks and shows Conclusion: remove laravel/framework 5.2.41
But in the instructions there is another method to install the package.
When I do that by editting the composer.json in the main Laravel dir. 'LaravelProjects' under xampp/htdocs with these lines:
"require": { "pcextreme/cloudstack-client": "~0.1" }
And then I run the "composer update" command.
I don't get any error.
But as soon as I follow these steps:
Once the package is installed you need to open app/config/app.php and register the required service provider:
`'providers' => [
'PCextreme\CloudstackClient\Providers\LaravelServiceProvider']`
The application breaks.
I can't see the basic page showing 'Laravel 5' on my server anymore.
Instead of that I get a fatal error:
Whoops, looks like something went wrong.
1/1 FatalErrorException in ProviderRepository.php line 146: Class
'PCextreme\CloudstackClient\Providers\LaravelServiceProvider' not found
Further in the instructions, when I give the command below:
php artisan config:publish pcextreme/cloudstack-client
I get this error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'PCextreme\CloudstackClient\Providers\LaravelServiceProvider' not found
I have tried out different things that I could find on internet but nothing seems to work in my case.
Could someone kindly help me out with this? Any help is greatly appreciated!
Execute in you project folder command: composer update

after installation of simple qrcode, blade engine doesnt work on laravel5

After installing illuminate/html, my blade engine was wrrking well. But when I installed simple qrCode via:
"require": {
"simplesoftwareio/simple-qrcode": "~1"
}
I get this error:
Class 'Illuminate\Html\HtmlServiceProvider' not found
the output of terminal after installation, simple qrcode was:
Warning: This development build of composer is over 60 days old. It is recommended to update it by running "/usr/bin/composer self-update" to get the latest version.
Key require is a duplicate in ./composer.json at line 53
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing illuminate/html (v5.0.0)
- Installing bacon/bacon-qr-code (1.0.1)
Downloading: 100%
- Installing simplesoftwareio/simple-qrcode (1.4.3)
Downloading: 100%
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider' not found in /home/farhad/public_html/letterPanel/laravel/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Illuminate\Html\HtmlServiceProvider' not found
Script php artisan optimize handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider' not found in /home/farhad/public_html/letterPanel/laravel/vendor/lara
vel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146
I also ran composer require illuminate/html after this error. But I get that same error.
Your composer.json file has two require keys, as mentioned in the composer error in your question:
Key require is a duplicate in ./composer.json at line 53
Remove to have a correctly formed composer.json file and retry.
You're installing module for Laravel 4 on Laravel 5 project. Html package was removed from Laravel 5.
You can look for another package or you could install Html package and adapt qrcode to work with Laravel 5.
The line "simpleoftwareio / simple-qrcode": "~ 1" must be within "require" that is already in your composer.json.

Homestead - composer global require is trying to find an incorrect package

I am trying to install Laravel Homestead, and when I enter the following command:
composer global require "laravel/homestead=~2.0"
It returns the error "Your requirements could not be resolved to an installable set of packages."
However, the error shows laavel not laravel as I inputted! Why is it autocorrecting to an incorrect spelling? How can I resolve this?
In order to fix this, I did the following:
sudo open .composer and then within composer.json I rectified the line which was spelt incorrectly.
For some reason, Composer wasn't picking up Laravel and Laavel are spelt differently?!

laravel 4 install issue when using composer install

When I run
composer.phar install
I get this error almost at the end of the installation, any ideas?
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/belendez/public_html/laravel/artisan on line 46
Parse error: syntax error, unexpected T_STRING in /home/belendez/public_html/laravel/artisan on line 46
Script php artisan optimize handling the post-install-cmd event returned with an error
I look into the suggested link and it appears that somehow in the middle of the installation it changes from 5.3 to 5.2! If I try to start installation using 5.2 it returns right a way: class 'Phar' not found. Any ideas?
It seems that issuing only a php command will pick up another version of the interpreter. Try to change all the references to php in your composer.phar file to the one you want actually to be executed (in your case it seems /opt/php53/bin/php).
You can confirm that by simply launching a php -v directly from the command line to see what version your server will pick up

Resources