Laravel 5 on PHP Artisan Config:Clear Generated Closure::_Set_State() Error

Laravel 5 on php artisan config:clear generated Closure::__set_state() error

I had faced the similar issue in past don't know what caused it but as of now you can delete the config.php from /vendor it won't break your code.

And your code will be start working..

laravel problem with bootstrap cache generate routes-v7

Your route has been cached. If you need to remove route caching you can use the command :

php artisan route:clear

You can cache your route again by :

php artisan route:cache

routes-v7.php is a file that is automatically generated when you cache routes.



Updates

This is Laravel which has a custom route, so the web.php file is not used.

To register a route file, you need to register it in app\Providers\RouteServiceProvider.php :

public function boot()
{
...

$this->routes(function () {
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));

Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php')); // Or custom route
});

...
}

Laravel 5 – Clear Cache in Shared Hosting Server

You can call an Artisan command outside the CLI.

Route::get('/clear-cache', function() {
$exitCode = Artisan::call('cache:clear');
// return what you want
});

You can check the official doc here
http://laravel.com/docs/5.0/artisan#calling-commands-outside-of-cli


Update

There is no way to delete the view cache. Neither php artisan cache:cleardoes that.

If you really want to clear the view cache, I think you have to write your own artisan command and call it as I said before, or entirely skip the artisan path and clear the view cache in some class that you call from a controller or a route.

But, my real question is do you really need to clear the view cache? In a project I'm working on now, I have almost 100 cached views and they weight less then 1 Mb, while my vendor directory is > 40 Mb. I don't think view cache is a real bottleneck in disk usage and never had a real need to clear it.

As for the application cache, it is stored in the storage/framework/cache directory, but only if you configured the file driver in config/cache.php. You can choose many different drivers, such as Redis or Memcached, to improve performances over a file-based cache.

PHP Fatal error when trying to install Laravel 5 with Composer

I think you are using a Laravel 4 composer.json. One of the big changes from Laravel 4 to Laravel 5 is the usage of namespaces.
Also a lot of paths have been modified, so just installing Laravel 5 over an existing Laravel 4 is not possible.
Better to install a fresh Laravel 5 and follow this guide:
http://laravel.com/docs/master/upgrade#upgrade-5.0

For reference here is my composer.json (notice the psr-4 in the autoload section)

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "5.0.*",
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php -r \"copy('.env.example', '.env');\"",
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}

Fresh installed laravel 5.6 getting HTTP ERROR 500 in index page

php artisan server runs the CLI version which is correct and the latest 7.1.

Your web server is still running the old PHP version. Make sure it is set up correctly with the latest version. Even if you delete the old version, your server can still keep it running in memory until the issue is resolved.

Try service php7.0-fpm stop and service php7.1-fpm restart and service nginx restart.

Laravel showing Failed to clear cache. Make sure you have the appropriate permissions

If the data directory doesn't exist under (storage/framework/cache/data), then you will have this error.

This data directory doesn't exist by default on a fresh/new installation.

Creating the data directory manually at (storage/framework/cache) should fix this issue.



Related Topics



Leave a reply



Submit