1
grabzit 라이브러리를 사용하여 Laravels IoC 컨테이너를 사용하여 비디오를 gif로 변환하고 있습니다.storage_path가 'app/..'디렉토리를 반환하는 이유
namespace App\Services;
use App\Contracts\VideoToGif;
use App\Clients\GrabzIt\GrabzItClient;
class GrabzitService implements VideoToGif {
...
public function save(array $input)
{
try {
$id = $input["id"];
$filename = $input["filename"];
$result = $this->client->GetResult($id);
$destinationPath = storage_path('media/gifs');
file_put_contents($destinationPath . "/" . $filename, $result);
} catch (Exception $e) {
throw $e;
}
}
는하지만이 오류가 발생합니다 :
ErrorException: file_put_contents(/app/storage/media/gifs/converted_file.gif): failed to open stream: No such file or directory in /app/app/Services/GrabzitService.php:65
확실하지 storage_path()
경우 앱 디렉토리를 반환한다고 가정 할 때 그것의 실제 프로젝트 루트입니다.
내가 뭘 잘못하고 있니?
내 프로젝트는 Heroku가에
이유 storage_path 그래도 올바른 경로를 반환하지 않습니다 :/응용 프로그램/storage <- 사실 앱 폴더 밖에있을 때. –
디렉토리 구조를 변경 했습니까? –
아니요, 모든 것이 재고입니다. –