Laravel Uncaught exception 'ReflectionException - php

Im getting an error when trying to launch a Laravel App .
Fatal error: Uncaught exception 'ReflectionException' with message 'Class log does not exist' in C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php:735
I have checked the .env file for spaces and found none. I also replaced each file in the config folder in a attempt to find out which one would throw the error. I also tried doing a dump just the mentioned line
dump($concrete, debug_backtrace());
I have also tried running composer dump-autoload and composer dump-autoload -o which promted me to put the composer.json file into the config directory
Then when ran again threw the error stating "Could not scan for classes inside database which does not appear to be a file nor a folder".
How can a isolate and sort this issue out ?

do:
$ composer dump-autoload -o
and try again

Related

Composer update - website stopped working

I updated the Composer using cmd window and got these errors:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Darryldecode\Cart\CartServiceProvider' not found
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output:
The website is not online yet, and I'm running it using xampp.
Now, when i'm trying to access my web site through localhost, I get this error:
FatalErrorException in ProviderRepository.php line 146:
Class 'Darryldecode\Cart\CartServiceProvider' not found.
In the app.php file I have:
Darryldecode\Cart\CartServiceProvider::class,
in the Application Service Providers, and:
'Cart' => Darryldecode\Cart\Facades\CartFacade::class,
in the aliases.
Any ideas on how to get the website back?
Thanks!
Tty this steps
Temporary remove
Darryldecode\Cart\CartServiceProvider::class,
And
'Cart' => Darryldecode\Cart\Facades\CartFacade::class,
Type command
composer update
And then add this class
Because when you update composer he try to find this path before adding in your project, After updating your composer this class added in your folder

Laravel issue with Patchwork UTF8

I have just pulled a remote Laravel project from Github and ran composer install to create the vendor folder.
However, this returns an error in the terminal:
[RuntimeException]
Could not scan for classes inside "/Applications/MAMP/htdocs/imperialnet/ve
ndor/patchwork/utf8/src/Normalizer.php" which does not appear to be a file
nor a folder
And this error in the error log:
PHP Fatal error: require(): Failed opening required '/Applications/MAMP/htdocs/app/vendor/symfony/var-dumper/Resources/functions/dump.php' (include_path='/Applications/MAMP/htdocs/app/vendor/phpseclib/phpseclib/phpseclib:.:/Applications/MAMP/bin/php/php5.6.2/lib/php') in /Applications/MAMP/htdocs/app/vendor/composer/autoload_real.php on line 58
Looking in Vendor > patchwork > utf8 there is no SRC folder? What is going with composer or ?
I had the same problem. Deleting the vendor folder and the composer.lock file and then running composer install solved the issue.
You may write in console: composer update --dev

ZendSkeletonAplicaton giving me errors

I am trying to int Zend framework 2. I aready have xampp running. I followed the steps on this answer. How ever when I visit the url I specified I get the following descriptive error:
Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to load ZF2. Run php composer.phar install or define a ZF2_PATH environment variable.' in C:\xampp\htdocs\ZendSkeletonApplication\init_autoloader.php:51 Stack trace: #0 C:\xampp\htdocs\ZendSkeletonApplication\public\index.php(18): require() #1 {main} thrown in C:\xampp\htdocs\ZendSkeletonApplication\init_autoloader.php on line 51
as the exception states. I went on to run the command php composer.phar install
and nothing happens. nothing displays on th cli to showing anything being installed. and when i run again application i get the same error. Where else can I look and check for errors. Thanks
I am using PHP Version 5.6.8
So what worked for me. I began again from scratch following the tutorial here
Then I still got a "could not open input file: composer.phar" when I ran the command: php composer.phar install
so according to "www.softanalyst.com/zend-2-framework-installation-with-xampp/#comment-883" I need to run the following command:
php -r "readfile('https://getcomposer.org/installer');" | php
which I did and it all worked.
open up your terminal and move To your project using the cd project directory
one type dir composer.phpr and try this one dir composer.json if both file listed than do the next step otherwise download the composer in current directory and run the following command as bellow.
php composer.phar install this comman will install all required dependency from the composer.json file. it will take time as depend on internet speed.
once it's complete than try this link for further steps.this link also having how To install composer And skeleton application.
Github
Twitter

Laravel 5 migration error

I was using migration with a database. Then i removed that database and created new one. Then i created migration files from the terminal via php artisan make:migration create_users.
Then i came back and tried to run the migration and it throws the following error with php artisan migrate
Error:
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with
message 'The stream or file
"/opt/lampp/htdocs/laravel/storage/logs/laravel.log" could not be
opened: failed to open stream: Permission denied' in
/opt/lampp/htdocs/laravel/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:95
And also a few more.
I googled and found that composer dump-autoload wil work, But it didn't and composer dump-autoload throws the same error.
php artisan migrate:reset throws the same error as php artisan migrate:reset.
Thanks
Change Permission of log folder of laravel
Give Read & Write permission
storage/logs
Changing Database:
1: Change DB name in config/database.php
2: root/.env DB_DATABASE=databasename
It's not the problem of autoloading. It is a problem of file permissions. Check if webserver can write to the storage/logs directory.

Laravel 4.1 gives error Uncaught exception 'ReflectionException' with message 'Class FatalErrorException

I have setup a basic REST API on my localhost. I have a little bit of a screwed up configuration. I am using MAMP with PHP 5.5.3 and installed Laravel via
composer create-project laravel/laravel heartbet --prefer-dist
I have everything working peachy on my localhost and it all seems in order with autoload. However when colleagues are pulling my GIT repo with the laravel CMS in it, it seems that the autload goes bad and it can't find the classes anymore. I am getting the following error on their machines:
PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Class FatalErrorException does not exist' in /Users/claes/co/heartbet/public/api/vendor/laravel/framework/src/Illuminate/Exception/Handler.php:316\nStack trace:\n#0 /Users/claes/co/heartbet/public/api/vendor/laravel/framework/src/Illuminate/Exception/Handler.php(316): ReflectionParameter->getClass()\n#1 /Users/claes/co/heartbet/public/api/vendor/laravel/framework/src/Illuminate/Exception/Handler.php(300): Illuminate\Exception\Handler->hints(Object(ReflectionFunction), Object(ReflectionException))\n#2 /Users/claes/co/heartbet/public/api/vendor/laravel/framework/src/Illuminate/Exception/Handler.php(237): Illuminate\Exception\Handler->handlesException(Object(Closure), Object(ReflectionException))\n#3 /Users/claes/co/heartbet/public/api/vendor/laravel/framework/src/Illuminate/Exception/Handler.php(145): Illuminate\Exception\Handler->callCustomHandlers(Object(ReflectionException))\n#4 [internal function]: Illuminate\Exception\Handler->handleException(Object(Reflecti in /Users/claes/co/heartbet/public/api/vendor/laravel/framework/src/Illuminate/Exception/Handler.php on line 316
I checked all my autloader and composer and everything seems to be in order. I tried
composer dump-autoload
composer install --no-scripts
Also tried something like composer dump-autoload -o without any success. I am still pretty new to the autloading scene and laravel.
Does anybody have any tips on how i can resolve this issue? I find it hard to know where to look for the problem exactly and other answers that i read up on so far all seem to suggest the above two to resolve any directory errors.
Thanks and cheers!
Kenneth

Categories