当我搜索此错误时,它似乎在 CentOS 中更常见,但我使用的是 Ubuntu 15.10。
我的问题是,我按照 ffmpeg-php 网站上的安装步骤进行操作,但在执行此命令时遇到了错误。
./configure && make
我收到以下错误
checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for a sed that does not truncate output... /bin/sed checking for cc... cc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ISO C89... none needed checking how to run the C preprocessor... cc -E checking for icc... no checking for suncc... no checking whether cc understands -c and -o together... yes checking for system library directory... lib checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for PHP prefix... /usr checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib checking for PHP extension directory... /usr/lib/php5/20131226 checking for PHP installed headers prefix... /usr/include/php5 checking if debug is enabled... no checking if zts is enabled... no checking for re2c... no configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. checking for gawk... no checking for nawk... nawk checking if nawk is broken... no checking for ffmpeg support... yes, shared checking whether to force gd support in ffmpeg-php... no checking for ffmpeg headers... configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option
我该如何解决这个问题?有些人说只需使用sudo apt-get install ffmpeg-dev`` or
ffmpeg-devel,但这两种方法都不起作用,而且现在没有解决方案,这让人很沮丧。好像只有我一个人遇到这个问题。
是的,我的 FFMPEG 已安装,如果我输入 ffmpeg -cmd,我就会从 ffmpeg 接收数据。而且我能够对视频进行编码,所以它已安装。
答案1
在 Ubuntu 中,FFmpeg 标头分布在几个包中,这些包是从ffmpeg
源包构建的。我想你应该安装所有这些包(此处列出):
$ sudo apt-get install libavcodec-dev libavcodec-ffmpeg-dev libavdevice-dev libavdevice-ffmpeg-dev \
libavfilter-dev libavfilter-ffmpeg-dev libavformat-dev libavformat-ffmpeg-dev libavresample-dev \
libavresample-ffmpeg-dev libavutil-dev libavutil-ffmpeg-dev libpostproc-dev libpostproc-ffmpeg-dev \
libswresample-dev libswresample-ffmpeg-dev libswscale-dev libswscale-ffmpeg-dev