PHP Fatal error: Class 'Bllim\Datatables\DatatablesServiceProvider' - php

I'm a newbie in Laravel. I just cloned my co-worker git and try to php artisan list but it gives me error
PHP Fatal error: Class 'Bllim\Datatables\DatatablesServiceProvider' not found in /Users/path-to-project/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 157
I can't find any documentations about this error and search results don't really help.
Any of you ever met this problem and care to help me fix this? Thank you.

Asking your coworker would be a first good step :)
That said, the error you're getting indicates that PHP can't find or autoload a Laravel Service provider class. If your coworker is following Laravel best practices, you should be able to fix this by running the following command from your root project directory (or the directory with a composer.json file)
$ composer install
or ...
$ composer.phhar install
The format of the command (phar or no phar) will depend on how you've installed composer, the dependency/package manager used in Laravel.

Related

Why Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found

I have a Laravel/Homestead project that is finally working locally. Now I'm trying to port it over to HostGator and can't get it running due to titled error. I've tried all the suggested solutions to no avail. Including:
composer require laravel/laravel
composer dump-autoload
composer install --no-scripts
composer update
composer update --no-scripts
Nothing works. Same error. If this is a clue, I also tried
php artisan clear-compiled
and get response of
Could not open input file: artisan
I'm about ready to give up on Laravel/Homestead. I've spent countless hours on this framework with nothing but problems to show for it. Would not recommend it to anybody.
You can see the error yourself here:
http://www.tekknow.net/MedAverter/medaverter/
Any suggestions before I throw in the towel?
For the artisan file, the artisan file is not required through includes, you have it in your root project, which is created when you create your Laravel project. Here is the file.
So you need to have that file in your project.
For the missing class, you try to require laravel/laravel but that is not the correct dependency. Again that github repo is a shell for a project, to have Laravel features you need to base of laravel/laravel and include laravel/framework.
Hope this clears up some confusing and can get you on the right track. Secondly you shouldn't port it over, but simply cloning your project and running composer install should be sufficient.
The problem turned out to be two issues.
1. The wrong version of PHP was running. If I ssh'ed into the hostgator server and did
php -v
It showed PHP 5.6.30 even though I had selected Php 7.1 in the cPanel PHP Selector. If I did
tekknow.net/phpinfo.php
it would say I was using 7.1. Called up HostGator tech support and they were able to change it to PHP 7.3.13.
Now if I do:
php artisan clear cache
I no longer get the error about
Parse error: syntax error, unexpected '?' in
/home1/sl1k7f3j/public_html/medaverter/bootstrap/app.php on line 15
which was an error caused by a version of php that doesn't support the ?? operator.
The second problem was a lack of memory issue. If I did
composer update
It would start to work but would fail in about 30 seconds with
Fatal error: Out of memory (allocated 709623808) (tried to allocate
34187559 bytes) in
phar:///opt/cpanel/composer/bin/composer/src/Composer/Json/JsonFile.php
on line 270
The HostGator tech rep could not figure out why that was happening but I got around that issue by manually uploading my local vendor folder to the host server.
Now when I go to http://tekknow.net/medaverter/ it works!

'Symfony\Component\HttpFoundation\Session\SessionBagInterface' not found

I am an end user of Drupal and I am trying to migrate my site (www.vagile.nl) from 8.1.x to 8.2.5. Now I am getting an HTTP 500 error, the phperror.txt says:
PHP Fatal error: Interface 'Symfony\Component\HttpFoundation\Session\SessionBagInterface' not found in D:\www\vagile.nl\www\vendor\symfony\http-foundation\Session\Storage\MetadataBag.php on line 24
When I look at the directory structure there is no directory in Symfony called Component. In the PHP file it says:
namespace Symfony\Component\HttpFoundation;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
Any ideas?
Thanks in advance!!
Cheers Tom.
It may not have been installed properly during the update. I am not a Drupal expert, but Symfony components are normally managed with Composer; if there is a composer.json or composer.lock file in your project, you may need to install dependencies with composer.
Have you tried a composer install? If you haven't got composer already, you can download it from https://getcomposer.org/

PHP Fatal error: Class 'Doctrine\\DBAL\\Platforms\\MySqlPlatform' not found

I have a symfony 2 project. It was running just fine two different ubuntu systems. Now I have deployed it to an OpenShift instance and get this error:
PHP Fatal error: Class 'Doctrine\\DBAL\\Platforms\\MySqlPlatform' not found in /var/lib/openshift/552ba6ecfcf93371e600007a/app-root/runtime/repo/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php on line 80
I have no idea where to look for the error. Any ideas?
Please check the file permissions. Is it executable? Does it exist at all?
The solution was:
- remove folder "vendor"
- remove file composer.lock
php composer.phar self-update
php composer.phar install
All good now

Laravel: PHP Fatal error: Class '...ServiceProvider' not found in /var/www/laravel/bootstrap/compiled.php on line #

I have been working on the same app for a little bit now, and I am moving it over to Laravel. This is not only my first experience with Laravel, but my first time using a PHP framework. It is awesome so far.
I have run into a problem in my testing, I am getting an error: Error Output: PHP Fatal error: Class '...ServiceProvider' not found in /var/www/laravel/bootstrap/compiled.php on line #
I am wondering what causes this error and how I can fix it . It gives me the direct line that is problematic. But I have no idea how to solve this issue.
I have tried a number of solutions including
composer install
composer update
composer dump-autoload
and others as well.
I have also attempted deleting the compiled.php file all together, but then it trips the same error on a different file. What is it causing this error, and how can I go about debugging it?
Thanks for help in advance!!
Try running the following command:
php artisan clear-compiled
If that gives you the same error, you'll have to manually delete the file:
rm app/bootstrap/compiled.php
For laravel 5.5.*
you can remove related ServiceProvider in this file
\bootstrap\cache\config.php

PHPUnit with Symfony Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\DoctrineBundle' not found

I'm trying to testing my app made with Symfony. I wrote a test and when I launch it, i get the following error:
Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\DoctrineBundle'
not found in /.../app/AppKernel.php on line 17
I had the same error with Symfony's MonologBundle, AsseticBundle and SwiftmailerBundle: then I've manually added these bundles into my app, so pheraps I have fixed those errors, but with Doctrine I've not found any solutions yet.
It looks like maybe you did not install the Doctrine bundle.
Try to go to the root of your project where the composer.phar is located through a console, and try to run it like this:
php composer.phar
It will install all dependencies of Symfony2,and hopefully everything is going to work :)

Categories