本文介绍了Laravel 5维护模式无需技师即可开启的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在托管我的网站时,是否有可能在没有php artisan上下命令的情况下打开和关闭Laravel 5维护?

Is there any possibility to turn on and turn off Laravel 5 maintenance without php artisan up and down commands when my website is being hosted ?

我所做的:

Route::get('site/shutdown', function(){
    return Artisan::call('down');
});

Route::get('site/live', function(){
    return Artisan::call('up');
}); 

第一条路线工作正常.但是当我打电话给现场/现场时,该站点仍然被关闭.什么会导致此问题?

The first route is working fine. But when I call site/live the site still is shuted down. What can cause this problem ?

推荐答案

如果您的项目已经关闭,则无法调用其他函数.

If your project is already down, you cannot call another function.

在使 php artisan down 运行后发生的事情是,它在 storage/framework 内创建了一个名为 down 的文件.在使 php artisan up 启动后,该文件将被删除.

What happens after you run php artisan down is that it creates a file named down inside storage/framework. After running php artisan up the file is removed.

您可以在存储/框架中手动创建文件.它将使您的项目失败.当您想重新启动项目时,只需删除文件即可.

You can create the file manually inside storage/framework. It will down your project. When you want to take your project live again, just remove the file.

这篇关于Laravel 5维护模式无需技师即可开启的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 03:30