問題描述
我已經以 root 身份使用 ssh 在我的專用服務器 (CentOS 7) 上成功安裝了 ffmpeg.
ffmpeg 工作正常 - 但現在我需要在沒有 root 訪問權限的情況下使用它.
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.
當我嘗試在沒有 root 訪問權限的情況下使用 ffmpeg 時,出現以下錯誤:
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
最終目標是能夠在我沒有 root 訪問權限的 PHP 腳本中使用 ffmpeg.
The final goal is to be able to use ffmpeg inside my PHP scripts which do not root access.
推薦答案
最簡單的解決方案是下載一個已經編譯好的 ffmpeg
二進制/可執行文件,并將您的腳本指向它.在 FFmpeg 下載 頁面上,請參閱獲取包部分以獲得指向最近針對 Linux、Windows 和 macOS 的靜態構建.
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.
您可以使用 shell_exec()
如FFmpeg Wiki: PHP 并提供下載的二進制文件的完整路徑.
You can use shell_exec()
as shown in FFmpeg Wiki: PHP and provide the full path to the downloaded binary.
這篇關于如何為 PHP 安裝 ffmpeg的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!