The output file's directory '***' could not be created
1、文件夹的权限我给了755,甚至777都试过了
2、文件夹我就算手动创建好都不行
错误提示
The output file's directory '/uploads/credit/recharge' could not be created
1. exception: "RuntimeException"
2. file: "/www/wwwroot/zhaiyanyan.com/vendor/knplabs/knp-snappy/src/Knp/Snappy/AbstractGenerator.php"
3. line: 578
4. message: "The output file's directory '/uploads/credit/recharge' could not be created."
AbstractGenerator.php第578行写的是,这里也是尝试建立文件夹,但是没有权限
if (!$this->isDir($directory) && !$this->mkdir($directory)) {
throw new \RuntimeException(sprintf(
'The output file\'s directory \'%s\' could not be created.',
$directory
));
所以,还有可能是什么问题
controller(SnappyImage会自动创建文件夹的)
SnappyImage::loadHtml('***')
->setOption('width', 1200)
->save('/uploads/credit/recharge/'.Auth::id().'.jpg');
/uploads/credit/recharge/ 建议用 public_path 或 storage_path 方法 生成路径吧