【问题标题】:libavdevice.so.57: failed to map segment from shared object: Permission denied"libavdevice.so.57:无法从共享对象映射段:权限被拒绝”
【发布时间】:2016-09-10 09:35:23
【问题描述】:

我已经成功安装了ffmpeg ver。 4.4.7 在 centos 上,启用共享:

[root@localhost ~]# ffmpeg
ffmpeg version N-81555-g496d97f Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)
  configuration: --prefix=/usr/local/ffmpeg_build --extra-cflags=-I/usr/local/ffmpeg_build/include --extra-ldflags=-L/usr/local/ffmpeg_build/lib --bindir=/usr/local/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-shared
  libavutil      55. 29.100 / 55. 29.100
  libavcodec     57. 54.102 / 57. 54.102
  libavformat    57. 48.102 / 57. 48.102
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 60.100 /  6. 60.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

但是,当我在 php 中运行时,通过 exec 我得到了

"/usr/local/bin/ffmpeg:加载共享库时出错: libavdevice.so.57:无法从共享对象映射段: 权限被拒绝”

我知道 Web 服务器以用户 'apache' 而不是 root 用户身份执行命令,但出于这个特定原因,我在 /usr/local/ffmpeg_build 中安装了 ffmpeg,以便普通用户可以使用 ffmpeg。

我错过了什么?这个错误是什么意思?

【问题讨论】:

  • 用户apache是否知道/usr/local/ffmpeg_build路径?
  • 我怎么知道它是否“知道”它?
  • 我已经将 /usr/local/ffmpeg_build 的所有权更改为具有 777 权限的 apache 只是为了尝试,然后重新启动 apache 没有运气,仍然是相同的结果。

标签: php ffmpeg


【解决方案1】:

好的,我在此链接上找到了答案 http://www.idmworks.com/fix-failed-map-segment-shared-object-permission-denied/

原来是 SElinux on Enforcing mode not Permissive,只要我将它设置为 permissive 模式,它就开始工作了。

$ getenforce
Enforcing
$ sudo setenforce 0
$ getenforce
Permissive

让它永久化

 vi /etc/selinux/config

并将执行更改为许可

SELINUX=enforcing

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-02-28
    • 1970-01-01
    • 1970-01-01
    • 2019-05-31
    • 2021-06-23
    • 2023-03-19
    • 1970-01-01
    • 2022-06-23
    相关资源
    最近更新 更多