Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install ffmpeg for PHP

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.

like image 389
Julie Bsd Avatar asked Oct 05 '16 22:10

Julie Bsd


1 Answers

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.

like image 99
llogan Avatar answered Sep 22 '22 13:09

llogan