6

I've successfully installed ffmpeg using ssh, as root, on my dedicated server (CentOS 7).
ffmpeg works fine - but now I need to use it without root access.

When i try to use ffmpeg without root access, I get the following error :

ffmpeg: error while loading shared libraries: libx264.so.148: 
        cannot open shared object file: No such file or directory

The final goal is to be able to use ffmpeg inside my PHP scripts which do not root access.

llogan
  • 121,796
  • 28
  • 232
  • 243
Julie Bsd
  • 191
  • 1
  • 2
  • 10

2 Answers2

10

The easiest solution is to download an already compiled ffmpeg binary/executable and point your script to it. On the FFmpeg Download page refer to the Get the packages section for links to recent static builds for Linux, Windows, and macOS.

You can use shell_exec() as shown in FFmpeg Wiki: PHP and provide the full path to the downloaded binary.

llogan
  • 121,796
  • 28
  • 232
  • 243
  • 1
    i've downloaded the pack in public_html, how to use it ? i don't understand how works a static build in php, do i need to call the exec() command ? thanks for help – Julie Bsd Oct 06 '16 at 17:24
  • 1
    at this moment php code doesn't exist except `` lol i need to know how to use this library to call `ffmpeg -i 123.mov -hls_segment_filename 'file%03d.ts' s1.m3u8` – Julie Bsd Oct 06 '16 at 17:34
  • You can use `shell_exec()` as shown in [FFmpeg Wiki: PHP](http://trac.ffmpeg.org/wiki/PHP) and provide the full path to the downloaded binary. – llogan Oct 06 '16 at 18:18
3

Maybe too late, But here is a updated solution:

Install the lib in your Operating System https://www.vultr.com/docs/how-to-install-ffmpeg-on-debian-8-or-9

Install for PHP 7.x via composer https://github.com/PHP-FFMpeg/PHP-FFMpeg

Oscar Romero
  • 231
  • 1
  • 2
  • 11