tony2001 / ffmpeg-php

PHP extension for video editing, wrapping ffmpeg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

configure: error: ffmpeg headers not found.

LeftH0ok opened this issue · comments

I have installed ffmpeg ffmpeg-devel by RPMFusion

then
i do
cd ffmpeg-php
./configure
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 for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
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

[root@localhost ffmpeg-php]# find / -name avcodec.h
/usr/include/ffmpeg/libavcodec/avcodec.h
/usr/include/ffmpeg/libavfilter/avcodec.h

Hi LeftH0ok,

You didn't specified which version of PHP. I used the defaults from CenOS 7.

ffmpeg-devel installs headers in /usr/include/ffmpeg and php-ffmpeg expects them in /usr/include.
Just copy or symlink all folders from within /usr/include/ffmpeg in /usr/include.

I know it's just a workaround but will get you with a functional php-ffmpeg.

thank you very much @eRadical

My operating environment is php5.6 centos6.6

I do as you asked

cp -r /usr/include/ffmpeg/lib* /usr/include/
./configure --with-php-config=/usr/bin/php-config
i fixed ffmpeg headers not found , then i do make it's error

[root@localhost ffmpeg-php]# make
/bin/sh /root/ffmpeg-php/libtool --mode=compile cc -I. -I/root/ffmpeg-php -DPHP_ATOM_INC -I/root/ffmpeg-php/include -I/root/ffmpeg-php/main -I/root/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/ffmpeg-php/ffmpeg_movie.c -o ffmpeg_movie.lo
libtool: compile: cc -I. -I/root/ffmpeg-php -DPHP_ATOM_INC -I/root/ffmpeg-php/include -I/root/ffmpeg-php/main -I/root/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/ffmpeg-php/ffmpeg_movie.c -fPIC -DPIC -o .libs/ffmpeg_movie.o
/root/ffmpeg-php/ffmpeg_movie.c: In function '_php_get_codec_name':
/root/ffmpeg-php/ffmpeg_movie.c:918: error: 'AV_CODEC_ID_MPEG2TS' undeclared (first use in this function)
/root/ffmpeg-php/ffmpeg_movie.c:918: error: (Each undeclared identifier is reported only once
/root/ffmpeg-php/ffmpeg_movie.c:918: error: for each function it appears in.)

See #21 for the proper solution. Until that PR is merged (if it ever is), you can clone my fork and it should built as-is.

I am facing the same issue. I have installed the FFmpeg through this guide:
https://www.linuxhelp.com/how-to-install-ffmpeg-on-centos-7-6

FFmpeg is installed and working properly with FFmpeg command but facing issue to install FFmpeg-php. See the screenshots below. Thanks

FFmpeg -version

image

./configure --with-php-config="ConfigPath"

image

i have same problem. in result i stuck here (after solving header missing)