0

I set up Laravel. But the 'artisan' didn't work. So I did like this.

*

CCNI@CCNI-WS MINGW64 ~/Cilostan $ php artisan --version PHP Warning: require(C:\Users\CCNI\Cilostan/vendor/autoload.php): failed to ope n stream: No such file or directory in C:\Users\CCNI\Cilostan\artisan on line 18 PHP Fatal error: require(): Failed opening required 'C:\Users\CCNI\Cilostan/ven dor/autoload.php' (include_path='.;C:\php\pear') in C:\Users\CCNI\Cilostan\artis an on line 18 CCNI@CCNI-WS MINGW64 ~/Cilostan $ composer dump-autoload Generating optimized autoload filesClass Illuminate\Foundation\ComposerScripts is not autoloadable, can not call post-autoload-dump script > @php artisan package:discover --ansi PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in C:\Users\CCNI\Cilostan\bootstrap\app.php:14 Stack trace: #0 C:\Users\CCNI\Cilostan\artisan(20): require_once() #1 {main} thrown in C:\Users\CCNI\Cilostan\bootstrap\app.php on line 14 Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255 

*

then I did "composer update". The updating was successful. However when I entered the server localhost:8000, the server error 500 occured.

How can I resolve this problem? Help me, please.

2 Answers 2

2

As I could see from your error:

PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application'

Seems like you're missing the mentioned file. The composer is trying to discover some package that has Illuminate\Foundation\Application file, but it can't resolve it, since it might be missing. Check if the file exists, if not, clear your application cache:

php artisan config:clear php artisan cache:clear php artisan optimize 

After that, try composer dump-autoload again.

If that still doesn't work, clear your application bootstrap cache manually, because it might cache non-exsisting files, which is located in bootsrap/cahce directory. You could see it's trying to locate the file there:

thrown in C:\Users\CCNI\Cilostan\bootstrap\app.php on line 14

So you could delete bootsrap\app.php content as well, or find the mentioned file and delete the line where it is mentioned.

Sign up to request clarification or add additional context in comments.

3 Comments

The Application file doesn't exist. So I followed the mentions you taught until clear bootstrap cache. But I can't understand 'So you could delete bootsrap\app.php content as well, or find the mentioned file and delete the line where it is mentioned.' Do you mean to delete line 14 in C:\Users\CCNI\Cilostan\bootstrap\app.php?
If it's right, I tried that but PHP Fatal error: Uncaught Error: Call to a member function singleton() on null in C:\Users\CCNI\Cilost an\bootstrap\app.php:29 Stack trace: #0 C:\Users\CCNI\Cilostan\artisan(20): require_once() #1 {main} thrown in C:\Users\CCNI\Cilostan\bootstrap\app.php on line 29 this error happend..
Inside the` bootsrap/app` , there are multiple cached classes that are trying to initiate when you run your application. If you deleted or edited some of them in the meantime, they are still located in cache and your application is trying to resolve them. So my suggestion was to delete all of the mentioned classes from bootsrap/app that couldn't get resolved. As for the other error, just follow the line numbers ( bootstrap\app.php on line 29 ) and delete them one by one if the errors keep happening.
0

first try this

composer install 

it will import your packages and create vendor folder. If you get error then first run

composer dump-autoload 

then

composer install 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.