I'm trying to install the package maddhatter/laravel-fullcalendar (Laravel helper for FullCalendar.io) with composer.
So here is the command I run:
'''
php ../../composer.phar require maddhatter/laravel-fullcalendar
'''
And here is the result:
Using version ^1.3 for maddhatter/laravel-fullcalendar
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing maddhatter/laravel-fullcalendar (v1.3.0): Downloading (100%)
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
php artisan clear-compiled
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()
Script php artisan clear-compiled handling the post-update-cmd event returned with error code 255
But now I wonder if the package is installed or not, because it now appears in my list of installed packages.
If anyone has the answer, thanks in advance.
Try to delete file compiled.php in your vendor directory manually, and then it started to work again.
Related
I am trying to run this command: composer require barryvdh/laravel-dompdf
And I get this in my cmd:
Using version ^1.0 for barryvdh/laravel-dompdf
./composer.json has been updated
Running composer update barryvdh/laravel-dompdf
Loading composer repositories with package information
Updating dependencies
Lock file operations: 5 installs, 0 updates, 0 removals
- Locking barryvdh/laravel-dompdf (v1.0.0)
- Locking dompdf/dompdf (v1.2.2)
- Locking phenx/php-font-lib (0.5.4)
- Locking phenx/php-svg-lib (0.4.1)
- Locking sabberworm/php-css-parser (8.4.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 5 installs, 0 updates, 0 removals
- Installing sabberworm/php-css-parser (8.4.0): Extracting archive
- Installing phenx/php-svg-lib (0.4.1): Extracting archive
- Installing phenx/php-font-lib (0.5.4): Extracting archive
- Installing dompdf/dompdf (v1.2.2): Extracting archive
- Installing barryvdh/laravel-dompdf (v1.0.0): Extracting archive
3 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
#php artisan package:discover --ansi
In PackageManifest.php line 178:
The C:\xampp\htdocs\Proyectos\Monitor\bootstrap\cache directory must be present and writable.
Script #php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
And even on top of that, my project stopped working and shows:
This error that I've never seen before
I tried everything that I found on internet, clear cache, update composer and still I get the same kind of error, I am using Laravel 9 version. I'm desperate please help
Step 1 : Delete the cache folder and recreate again in bootstrap directory.
step 2 : run the command php artisan cache:clear
Hi i'm new to laravel socialite,when i run the command php artisan config:cache to update the .env file i get this error: Call to undefined method Laravel\Socialite\Facades\Socialite::isDeferred();
composer require laravel/socialite
Using version ^5.1 for laravel/socialite
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals
Installing ralouphie/getallheaders (3.0.3): Loading from cache
Installing guzzlehttp/psr7 (1.7.0): Loading from cache
Installing guzzlehttp/promises (1.4.0): Loading from cache
Installing guzzlehttp/guzzle (7.2.0): Loading from cache
Installing league/oauth1-client (v1.8.2): Loading from cache
Installing laravel/socialite (v5.1.0): Loading from cache
'C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5' is not a zip archive.
Unzip with ZipArchive class failed, falling back to unzip command
Failed to download laravel/socialite from dist: Failed to execute (9) unzip -qq -o "C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5" -d "C:\x
ampp\htdocs\matatu6.0/vendor/composer/5556bc2b"
[C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5 or
C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5.zip, and cannot find C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231
e2c48e7a17aefd5.ZIP, period.
Now trying to download from source
Installing laravel/socialite (v5.1.0): Cloning 14082c6651 from cache
guzzlehttp/psr7 suggests installing laminas/laminas-httphandlerrunner (Emit PSR-7 responses)
guzzlehttp/guzzle suggests installing ext-intl (Required for Internationalized Domain Name (IDN) support)
Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.
Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.
Writing lock file
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
#php artisan package:discover --ansi
In ProviderRepository.php line 149:
Call to undefined method Laravel\Socialite\Facades\Socialite::isDeferred()
Script #php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Installation failed, reverting ./composer.json to its original content.
update: upgrading from the laravel 5 way of declaring provide class in config/app, this ended up conflicting with laravel 6 package auto discovery, therefore causing even php artisan config:clear and composer dump-autoload not to work. removing 'Socialite' => Laravel\Socialite\Facades\Socialite::class in config/app.php solved this issue and re-installing the socialite package
PHP Fatal Error – yii\base\ErrorException Class 'Da\QrCode\QrCode'
not found
code fires the Err in my TaolistController.php
use Da\QrCode\QrCode;
public function actionGenQrcode(){
$qrCode = (new QrCode($kaSTR))//right here
->setSize(250)
->setMargin(5)
->useForegroundColor(51, 153, 255);
}
I've used composer to add 2amigos.
C:\Users\cyh>composer require 2amigos/qrcode-library:~1.1
./composer.json has been created Loading composer repositories with
package information Updating dependencies (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
- Installing khanamiryan/qrcode-detector-decoder (1): Downloading (100%)
- Installing bacon/bacon-qr-code (1.0.3): Downloading (100%)
- Installing 2amigos/qrcode-library (1.1.2): Downloading (100%) Writing lock file Generating autoload files
Actually my phpstorm can find this class. I'm using yiiframework.
run the following command using terminal(CMD)
composer dump-autoload
this command will dumps the autoloaded files
if this not working try to use it like Component
http://qrcode-library.readthedocs.io/en/latest/yii/qrcode-component/
Try install QR Code library using
composer require 2amigos/qrcode-library
It works for me. Good luck.
I run my local environment on docker /w shared code volumes.
When my Dockerfile runs php artisan optimize it fails with...
Step 14/15 : RUN composer install && composer update
---> Running in 94698cafb7bf
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 0 installs, 2 updates, 0 removals
- Updating aws/aws-sdk-php (3.30.0 => 3.30.2): Downloading (100%)
- Updating barryvdh/laravel-ide-helper (v2.3.2 => v2.4.0): Downloading (100%)
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Illuminate\Foundation\Console\TestMakeCommand' not found
Script php artisan optimize handling the post-install-cmd event returned with error code 1
However, it I run locally php artisan optimize it works fine, and also if I remove that from composer.json it will build fine and I can run it on the container with no issues, I don't understand the difference why it wouldn't run when building the container?
I installed emanuelzh/loptimizer for Laravel 5 (on Ubuntu). It is a fork from https://github.com/approached/laravel-image-optimizer
It is for image optimization.
I successfully installed it with composer:
composer.phar require emanuelzh/loptimizer
Using version ^1.0 for emanuelzh/loptimizer ./composer.json has been
updated php artisan clear-compiled Loading composer repositories with
package information Updating dependencies (including require-dev)
- Installing emanuelzh/loptimizer (1.0.0) Downloading: 100% Writing lock file Generating autoload files php artisan optimize
Generating optimized class loader
But the problem is with config/app.php file. I added the following line but it doesn't work when I try to publish.
config/app.php:
Emanuelzh\Loptimizer\ServiceProvider::class,
Publish command:
php artisan vendor:publish
Result of publish command:
Nothing to publish for tag [].
Do you know what is the correct line to add in config/app.php ?
Thanks for your help.
Remy
Ok. Finally I found the answer :)
The line to add in config/app.php is:
Approached\LaravelImageOptimizer\ServiceProvider::class,
and for the facade:
'ImageOptimizer' => Approached\LaravelImageOptimizer\ImageOptimizer::class,
Hope it helps!