Bonky Zhu
If someone is able to show me that what I think or do is not right, I will happily change, for I seek the truth, by which no one was ever truly harmed. It is the person who continues in his self-deception and ignorance who is harmed.



一般来说,使用我们使用 nextcloud 的 occ 命令即可解决问题:

sudo -u  /occ files:scan --all


屏幕快照 2019-11-12 上午9.02.25

同时,occ 命令还有一下用法

files files:cleanup #清楚文件缓存
files:transfer-ownership #将所有文件和文件夹都移动到另一个文件夹


运行 occ 指令出现错误

$ /www/wwwroot/ files:scan --all
PHP Parse error:  syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /www/wwwroot/ on line 94

检查 php -v 版本发现是 5.4.16,原因是在 /usr/bin下的 php 仍然是 5.4 版本的,而宝塔中我安装的是 7.2

PHP 5.4.16 (cli) (built: Nov  1 2019 16:04:20) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

然后只需要加入宝塔的 php 路径:

export PATH="/www/server/php/72/bin/:$PATH"  

然后又报错:/usr/bin/env: php: No such file or directory,原来是我的新的 php/usr/bin 下没有,只需要添加下连接即可:

ln /www/server/php/72/bin/php /usr/bin/php


You may also like...