laravel artisan error while clearing config cache - php

when I run php artisan cache:config the command throw the following error
PHP Warning: require(): Filename cannot be empty in /home/****/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 71
PHP Fatal error: require(): Failed opening required '' (include_path='.:/usr/share/php') in /home/****/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 71
I have no idea what causing this and how to fix it.

it turns out that there is one suspicious file inside config folder, once it's deleted the artisan command works just fine again.

Related

I am getting these errors in laravel while running existing project file on my localhost

Warning: require_once(C:\xampp\htdocs\skillrashtra/public/index.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\skillrashtra\server.php on line 21
Fatal error: require_once(): Failed opening required
'C:\xampp\htdocs\skillrashtra/public/index.php'
(include_path='.;C:\php\pear') in
C:\xampp\htdocs\skillrashtra\server.php on line 21
I have tried all these commands in order to solve this but didn't work.
composer update
copy .env.example .env
php artisan key:generate

Running "laravel new" command in laravel project

I accidentally ran the laravel new command in a laravel project, which apparently deleted autoload_real.php
I get these error messages when running php artisan serve:
"PHP Warning: require(C:\xampp\htdocs\e-commerce\vendor\composer/../symfony/polyfill-ctype/bootstrap.php): failed to open stream: No such file or directory in C:\xampp\htdocs\e-commerce\vendor\composer\autoload_real.php on line 66
Warning: require(C:\xampp\htdocs\e-commerce\vendor\composer/../symfony/polyfill-ctype/bootstrap.php): failed to open stream: No such file or directory in C:\xampp\htdocs\e-commerce\vendor\composer\autoload_real.php on line 66
PHP Fatal error: require(): Failed opening required 'C:\xampp\htdocs\e-commerce\vendor\composer/../symfony/polyfill-ctype/bootstrap.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\e-commerce\vendor\composer\autoload_real.php on line 66
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\e-commerce\vendor\composer/../symfony/polyfill-ctype/bootstrap.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\e-commerce\vendor\composer\autoload_real.php on line 66"
Is there a way to get back autoload_real.php?
Just run:
composer update
inside your project, it should fix it.
Check if the file actually exists. If it's missing, but the folder 'symfony/polyfill-ctype' is there and empty, try to delete vendor folder and run composer install again. It might be that composer install crashed previous time and it thinks the package is there. That was the case for me.

I can't execute php artisan serve on linux

Whenever i try to execute php artisan serve command i get this error
PHP Warning: require(/home/mehdi/laravelOrig/vendor/autoload.php):
failed to open stream: No such file or directory in
/home/mehdi/laravelOrig/artisan on line 18
PHP Fatal error: require(): Failed opening required
'/home/mehdi/laravelOrig/vendor/autoload.php'
(include_path='.:/usr/share/php') in /home/mehdi/laravelOrig/artisan
on line 18
I did try some answers i found on google and here but it still wont work , am I missing something ?
Thank you!
First of all install composer on your system and type following command.
1) goto your project directory from command line
2) composer update
3) php artisan serve.

xampp does not run fatal error

I got the following warning and error working on laravel project using xampp:
Warning: Unknown: failed to open stream: No such file or directory in
Unknown on line 0
Fatal error: Unknown: Failed opening required 'server.php'
(include_path='C:\xampp\php\PEAR') in Unknown on line 0
Solved
My antivirus deleted some of my files. I just turned off and now is working.
just run in cmd or terminal depends on your os
cd c:/xammp/htdocs/your_laravel_project
php artisan serve
Make sure you installed composer

Running PHPUnit on command line errors out

I run this on the command line: phpunit --version
I get the following errors:
PHP Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in /usr/lib/php/pear/PHPUnit/Autoload.php on line 45
PHP Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.:/Users/dennismonsewicz/pear/share/pear:/usr/local/share/pear:/usr/lib/php/pear/PHPUnit') in /usr/lib/php/pear/PHPUnit/Autoload.php on line 45
Anyone else run into these issues? It is also causing me issues when I try to run my tests via the command line.
Ended being an issue with my include_path
This is my updated include path
include_path = ".:/php/includes:/usr/lib/php/pear"

Categories