【发布时间】:2017-06-11 12:42:51
【问题描述】:
我关注了这个Git repo
一切正常。
我可以通过 SSH 发出php artisan varnish:flush。
但是当我试图从脚本中刷新缓存时,我得到了错误
sudo:不存在 tty,也没有指定 askpass 程序
这就是我在 routes.php 中添加的方式
Route::get('/flush', function() {
Artisan::call('varnish:flush');
});
我也试过了
Route::get('/flush', function() {
(new Spatie\Varnish\Varnish())->flush();
});
这是完全错误的样子。
ProcessFailedException in Varnish.php line 64:
The command "sudo varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 'ban req.http.host ~ (^www.host.com$)'" failed.
Exit Code: 1(General error)
Working directory: /home/admin/web/host.com/public_html
Output:
================
Error Output:
================
sudo: no tty present and no askpass program specified
我在 VPS 上使用 Vesta CP。
为我找到解决此错误的解决方案..
【问题讨论】:
标签: linux laravel ssh sudo tty