0

I have trouble with ffmpeg. If I want to create a thumb from a video I get the following error-message:

file_exists(): open_basedir restriction in effect. File(/tmp/frame59c41921d102f6.99590608.jpg) is not within the allowed path(s): (/home/admin/web/faplink.net/public_html:/home/admin/tmp)

Code:

$video_thumb_path = "thumbs/" . md5($request->file("file")->getClientOriginalName() . time()) . ".png";
          $mov = new \ffmpeg_movie(storage_path("app/public/") . $post->media);
          $frame = $mov->getFrame(10);
          if ($frame) {
              $gd_image = $frame->toGDImage();
              if ($gd_image) {
                  imagepng($gd_image, $video_thumb_path);
                  imagedestroy($gd_image);
                  $post->thumb = $video_thumb_path;
              }
          }
          break;

I Use CentOS7

Martin Giuliani
  • 391
  • 1
  • 3
  • 6
  • take a look [here](https://stackoverflow.com/a/26419085/4881811) it's the same thing !! – Maraboc Sep 21 '17 at 12:07
  • i don't know where i can change tempnam ... – Martin Giuliani Sep 21 '17 at 12:43
  • Have you access to the server configuration file (e.g. httpd.conf) ?? – Maraboc Sep 21 '17 at 12:46
  • You need to modify or disable the `open_basedir` directive in your PHP configuration file (`php.ini`) as mentioned in the answer to [open_basedir, File() is not within the allowed path](https://stackoverflow.com/questions/26411683/open-basedir-file-is-not-within-the-allowed-path), or use a path that is listed in `open_basedir`. – llogan Sep 21 '17 at 17:42

0 Answers0