barryvdh / laravel-dompdf

A DOMPDF Wrapper for Laravel
MIT License
6.66k stars 967 forks source link

PHP Fatal error: Class 'Barryvdh\DomPDF\ServiceProvider' not found in /var/www/sgi/trunk/SGI/vendor/compiled.php on line 6466 [Symfony\Component\Debug\Exception\FatalErrorException] Class 'Barryvdh\DomPDF\ServiceProvider' not found #128

Closed adiesdiaz closed 6 years ago

adiesdiaz commented 9 years ago

Hi, i did follow all the steps that are in readme.md so i don't know what i should do any help or suggestion , please!

marcelgruber commented 9 years ago

Any updates on this?

somnathpzalte commented 8 years ago

same problem Class 'Barryvdh\DomPDF\ServiceProvider' not found

errorfile

Is there any solution

marcelgruber commented 8 years ago

Try removing the provider from your app.php. Run "composer install" and then put it back in there.

somnathpzalte commented 8 years ago

still i got same error

my code

somnathpzalte commented 8 years ago

{ "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "php": ">=5.5.9", "laravel/framework": "5.1.", "illuminate/html": "^5.0", "laravel/socialite" : "^2.0", "way/generators":"~3.0", "laracasts/flash": "~1.3", "intervention/image": "^2.3", "granitibrahimi/google-recaptcha-laravel": "1.1.@dev", "aws/aws-sdk-php-laravel": "~3.0", "cviebrock/eloquent-sluggable": "^3.0" "barryvdh/laravel-dompdf": "0.6.", }, "require-dev": { "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.", "enyo/dropzone": "*" }, "autoload": { "classmap": [ "database" ], "psr-4": { "App\": "app/" } }, "autoload-dev": { "classmap": [ "tests/TestCase.php" ] }, "scripts": { "post-install-cmd": [ "php artisan clear-compiled", "php artisan optimize" ], "pre-update-cmd": [ "php artisan clear-compiled" ], "post-update-cmd": [ "php artisan optimize" ], "post-root-package-install": [ "php -r \"copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "php artisan key:generate" ] }, "config": { "preferred-install": "dist" } }

somnathpzalte commented 8 years ago

App.php provider array

'providers' => [

    /*
     * Laravel Framework Service Providers...
     */
    Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
    Illuminate\Auth\AuthServiceProvider::class,
    Illuminate\Broadcasting\BroadcastServiceProvider::class,
    Illuminate\Bus\BusServiceProvider::class,
    Illuminate\Cache\CacheServiceProvider::class,
    Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
    Illuminate\Routing\ControllerServiceProvider::class,
    Illuminate\Cookie\CookieServiceProvider::class,
    Illuminate\Database\DatabaseServiceProvider::class,
    Illuminate\Encryption\EncryptionServiceProvider::class,
    Illuminate\Filesystem\FilesystemServiceProvider::class,
    Illuminate\Foundation\Providers\FoundationServiceProvider::class,
    Illuminate\Hashing\HashServiceProvider::class,
    Illuminate\Mail\MailServiceProvider::class,
    Illuminate\Pagination\PaginationServiceProvider::class,
    Illuminate\Pipeline\PipelineServiceProvider::class,
    Illuminate\Queue\QueueServiceProvider::class,
    Illuminate\Redis\RedisServiceProvider::class,
    Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
    Illuminate\Session\SessionServiceProvider::class,
    Illuminate\Translation\TranslationServiceProvider::class,
    Illuminate\Validation\ValidationServiceProvider::class,
    Illuminate\View\ViewServiceProvider::class,
    Illuminate\Html\HtmlServiceProvider::class,
    Laravel\Socialite\SocialiteServiceProvider::class,
    Gibrahimi\ReCaptcha\ServiceProvider::class,
    Cviebrock\EloquentSluggable\SluggableServiceProvider::class,

    /*
     * Application Service Providers...
     */
    App\Providers\AppServiceProvider::class,
    App\Providers\AuthServiceProvider::class,
    App\Providers\EventServiceProvider::class,
    App\Providers\RouteServiceProvider::class,
    App\Providers\ViewComposerServiceProvider::class,
    Laracasts\Flash\FlashServiceProvider::class,
    Intervention\Image\ImageServiceProvider::class,
    Barryvdh\DomPDF\ServiceProvider::class,
    'PDF'       => Barryvdh\DomPDF\Facade::class,        
],
marcelgruber commented 8 years ago

Run "composer remove jenssegers/dompdf" , remove references in app.php, run "composer require jenssegers/dompdf" then "composer update" then add references back in app.php

On Sun, Nov 22, 2015 at 8:54 PM -0800, "Somnath Zalte" notifications@github.com wrote:

App.php provider array

'providers' => [

/*
 * Laravel Framework Service Providers...
 */
Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Routing\ControllerServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Illuminate\Html\HtmlServiceProvider::class,
Laravel\Socialite\SocialiteServiceProvider::class,
Gibrahimi\ReCaptcha\ServiceProvider::class,
Cviebrock\EloquentSluggable\SluggableServiceProvider::class,

/*
 * Application Service Providers...
 */
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\ViewComposerServiceProvider::class,
Laracasts\Flash\FlashServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
Barryvdh\DomPDF\ServiceProvider::class,
'PDF'       => Barryvdh\DomPDF\Facade::class,        

],

— Reply to this email directly or view it on GitHub.

somnathpzalte commented 8 years ago

if i run this command composer remove jenssegers/dompdf

below error occur

jenssegers/dompdf is not required in your composer.json and has not been removed

php artisan clear-compiled

[Symfony\Component\Debug\Exception\FatalErrorException] Class 'Barryvdh\DomPDF\ServiceProvider' not found

Script php artisan clear-compiled handling the pre-update-cmd event returned wit h an error

[RuntimeException] Error Output:

remove [--dev] [--no-progress] [--no-update] [--update-no-dev] [--update-with-de pendencies] [--ignore-platform-reqs] [-o|--optimize-autoloader] [-a|--classmap-a uthoritative] [packages1] ... [packagesN]

marcelgruber commented 8 years ago

Remove the references in your app.php!

Sent from Outlook

On Sun, Nov 22, 2015 at 9:13 PM -0800, "Somnath Zalte" notifications@github.com wrote:

if i run this command

composer remove jenssegers/dompdf

below error occur

jenssegers/dompdf is not required in your composer.json and has not been removed

php artisan clear-compiled

[Symfony\Component\Debug\Exception\FatalErrorException]

Class 'Barryvdh\DomPDF\ServiceProvider' not found

Script php artisan clear-compiled handling the pre-update-cmd event returned wit

h an error

[RuntimeException]

Error Output:

remove [--dev] [--no-progress] [--no-update] [--update-no-dev] [--update-with-de

pendencies] [--ignore-platform-reqs] [-o|--optimize-autoloader] [-a|--classmap-a

uthoritative] [packages1] ... [packagesN]

— Reply to this email directly or view it on GitHub.

somnathpzalte commented 8 years ago

after all this process got some errors

FatalErrorException in ProviderRepository.php line 119: Call to undefined method Barryvdh\DomPDF\Facade::isDeferred()

somnathpzalte commented 8 years ago

it works now.. Thank you.

marcelgruber commented 8 years ago

Good good. Remember to close the issue, friend

ripunjoy-sarma commented 8 years ago

I have uploaded my laravel project to server ...all is going well..but when i added dompdf in composer.json and classes to config/app.php it is showing Class 'Barryvdh\DomPDF\ServiceProvider' not found as i dont have ssh/ssl access from server here is my url http://www.guwahatiresearchgroup.in/ as it running in my localhost well bcz i can add barryvdh dompdf from composer update but in server i cannot access ssh and i have uploaded barryvdh folder and dompdf folder from vendor folder to server vendor folder but still i am getting this error..where is my issue..plz help me...

marcelgruber commented 8 years ago

If you don't have SSH access, I'm assuming you have FTP access? If so, I suppose you'll need to directly copy the entire project over to ensure all of the config files remain intact. You must be missing some important file somewhere.

On Sun, Dec 13, 2015 at 1:01 PM, ripunjoy-sarma notifications@github.com wrote:

I have uploaded my laravel project to server ...all is going well..but when i added dompdf in composer.json and classes to config/app.php it is showing Class 'Barryvdh\DomPDF\ServiceProvider' not found as i dont have ssh/ssl access from server here is my url http://www.guwahatiresearchgroup.in/ as it running in my localhost well bcz i can add barryvdh dompdf from composer update but in server i cannot access ssh and i have uploaded barryvdh folder and dompdf folder from vendor folder to server vendor folder but still i am getting this error..where is my issue..plz help me...

— Reply to this email directly or view it on GitHub https://github.com/barryvdh/laravel-dompdf/issues/128#issuecomment-164293671 .

ripunjoy-sarma commented 8 years ago

ya..of course i have ftp access...i have already uploaded the files to server but thing is that dompdf was installed to localhost and it works fine with localhost...and what i do i just change the composer.json just add barryvdh/laravel-dompdf": " 0.6.* in server composer.json file and upload baaryvdh and dompdf folder from localhost to server vendor folder...but i am getting this error..and its not possible to do all upload the laravel files again as site is live...

ripunjoy-sarma commented 8 years ago

thnx for reply

ripunjoy-sarma commented 8 years ago

as my localhost files and server files are not same...i did it for testing purpose in localhost but the actual files are in server...

marcelgruber commented 8 years ago

who cares if the site is live? it's broken. delete the files and reupload all of them with the proper configuration. your database will still be in tact.

marcelgruber commented 8 years ago

or remove the reference to dompdf in app.config if you need your site working

ripunjoy-sarma commented 8 years ago

ok...thnx...lets see...i had already mail to server administrator to provide me ssh access..if they will then i will do composer update from server terminal...

marcelgruber commented 8 years ago

yeah for sure. easiest thing to do is to get SSH access. it's pretty hard to work with laravel if you can't access the command line.

On Sun, Dec 13, 2015 at 1:34 PM, ripunjoy-sarma notifications@github.com wrote:

ok...thnx...lets see...i had already mail to server administrator to provide me ssh access..if they will then i will do composer update from server terminal...

— Reply to this email directly or view it on GitHub https://github.com/barryvdh/laravel-dompdf/issues/128#issuecomment-164295945 .

ripunjoy-sarma commented 8 years ago

ya..its true...its pretty hard...anyway thnx...

TeraFumba commented 7 years ago

I have a similar problem guys I was running i created my laravel application on windows (locally) it was running fine , now i changed operating system to Ubuntu and i have been following steps from this https://gist.github.com/hootlex/da59b91c628a6688ceb1 tutorial . when i excetute some of the commands i get this error "[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Barryvdh\DomPDF\serviceProvider' not found ".

i have removed the class in the providers array , and aliases array please help guys

kikinbmk10 commented 6 years ago

@somnathpzalte How did you solve the problem?

appledev44 commented 6 years ago

Hi.. If you check above comment of provider array posted by somnathpzalte commented on Nov 23, 2015 He is adding below both line in provider array. That is wrong. Barryvdh\DomPDF\ServiceProvider::class, 'PDF' => Barryvdh\DomPDF\Facade::class,

Solution - Barryvdh\DomPDF\ServiceProvider::class, add this line in "Provider" array. and 'PDF' => Barryvdh\DomPDF\Facade::class, add this line in "aliases" array.

MaungC commented 6 years ago

run this command composer require barryvdh/laravel-dompdf

jomalago3788 commented 5 years ago

como puedo solucionar ese error

[Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Barryvdh\DomPDF\ServiceProvider' not found

Atranaz commented 4 years ago

Can't Add in my app.php file :/

When I try to add in my service provider it gives me issue Barryvdh\DomPDF\ServiceProvider::class,

BTW my Laravel framework is 7 is it working with 7?

IsaacQuirozMasters commented 1 year ago

ste problema indica que la versión de barryvdh/laravel-dompdf especificada en el archivo composer.json del proyecto Laravel no coincide con la versión instalada en el sistema. Parece que el archivo composer.json del proyecto está especificando que se necesita la versión 2.1 de barryvdh/laravel-dompdf, pero el sistema tiene instalada una versión diferente.

Para resolver este problema, hay varias opciones:

Actualizar la versión especificada en el archivo composer.json: Si desea usar la versión de barryvdh/laravel-dompdf que ya tiene instalada en el sistema, puede actualizar el archivo composer.json para que la versión especificada coincida con la versión instalada. Por ejemplo, si tiene la versión 2.0.0 instalada, puede cambiar la versión especificada en el archivo composer.json a "barryvdh/laravel-dompdf": "2.0.*". Después de actualizar el archivo composer.json, puede ejecutar el comando composer update para actualizar las dependencias.

Instalar la versión correcta de barryvdh/laravel-dompdf: Si desea usar la versión 2.1 específicamente, puede instalar esa versión utilizando el comando composer require barryvdh/laravel-dompdf:^2.1. Este comando instalará la última versión estable de la rama 2.1.

Permitir versiones más flexibles: Puede cambiar la restricción de versión en el archivo composer.json para permitir versiones más flexibles de barryvdh/laravel-dompdf. Por ejemplo, puede cambiar "barryvdh/laravel-dompdf": "2.1" a "barryvdh/laravel-dompdf": "^2.1". Esto permitirá que Composer instale la última versión estable de la rama 2.x.

En cualquier caso, después de hacer cambios en el archivo composer.json, debe ejecutar el comando composer update para actualizar las dependencias.

IsaacQuirozMasters commented 1 year ago

This problem indicates that the version of barryvdh/laravel-dompdf specified in the composer.json file of the Laravel project does not match the version installed in the system. It appears that the composer.json file of the project is specifying that version 2.1 of barryvdh/laravel-dompdf is needed, but the system has a different version installed.

To resolve this problem, there are several options:

Update the specified version in the composer.json file: If you want to use the version of barryvdh/laravel-dompdf already installed on the system, you can update the composer.json file so that the specified version matches the installed version. For example, if you have version 2.0.0 installed, you can change the specified version in the composer.json file to "barryvdh/laravel-dompdf": "2.0.*". After updating the composer.json file, you can run the composer update command to update the dependencies.

Install the correct version of barryvdh/laravel-dompdf: If you want to use version 2.1 specifically, you can install that version using the composer require barryvdh/laravel-dompdf:^2.1 command. This command will install the latest stable version of the 2.1 branch.

Allow more flexible versions: You can change the version constraint in the composer.json file to allow more flexible versions of barryvdh/laravel-dompdf. For example, you can change "barryvdh/laravel-dompdf": "2.1" to "barryvdh/laravel-dompdf": "^2.1". This will allow Composer to install the latest stable version of the 2.x branch.

In any case, after making changes to the composer.json file, you should run the composer update command to update the dependencies.