While installing ffmpeg-php-0.6.0 on centos server, if you may came across the below error , like ::
In file included from /usr/include/sys/stat.h:107, from /usr/include/php/main/php_streams.h:28, from /usr/include/php/main/php.h:395, from /root/ffmpeg-php-0.6.0/ffmpeg-php.c:40: /usr/include/bits/stat.h:91: error: field ‘st_atim’ has incomplete type /usr/include/bits/stat.h:92: error: field ‘st_mtim’ has incomplete type /usr/include/bits/stat.h:93: error: field ‘st_ctim’ has incomplete type /usr/include/bits/stat.h:152: error: field ‘st_atim’ has incomplete type /usr/include/bits/stat.h:153: error: field ‘st_mtim’ has incomplete type /usr/include/bits/stat.h:154: error: field ‘st_ctim’ has incomplete type In file included from /usr/include/php/main/php_streams.h:28, from /usr/include/php/main/php.h:395, from /root/ffmpeg-php-0.6.0/ffmpeg-php.c:40: /usr/include/sys/stat.h:367: error: array type has incomplete element type /usr/include/sys/stat.h:374: error: array type has incomplete element type In file included from /usr/include/php/main/php.h:401, from /root/ffmpeg-php-0.6.0/ffmpeg-php.c:40: /usr/include/php/TSRM/tsrm_virtual_cwd.h:218: error: expected specifier-qualifier-list before ‘time_t’ /usr/include/php/TSRM/tsrm_virtual_cwd.h:246: error: expected declaration specifiers or ‘...’ before ‘time_t’ /root/ffmpeg-php-0.6.0/ffmpeg-php.c: In function ‘zm_startup_ffmpeg’: /root/ffmpeg-php-0.6.0/ffmpeg-php.c:94: warning: implicit declaration of function ‘avcodec_init’
After looking up for hours, I found the issue that ffmpeg own time.h file was conflicting with centos own time.h file, unfortunately ffmpeg-php has not been updated in a long time, so decided to search ffmpeg php extension on github and I found a repo maintained by tony2001 who has made some changes to the original project and using his repo I’m able to install it on CentOS-6.5 but I guess it works on other centos versions too
Follow the steps below to install it
git clone https://github.com/pbek/ffmpeg-php.git cd ffmpeg-php phpize ./configure make && make install
error: field ‘st_atim’ has incomplete type FFMPEG
A lot of tks to you!!!!!!! i am a chinese , this problem confused me two days! thanks for helping me to fix it!
Thanks man 🙂
Hi, i have another problem when i was install ffmpeg-php on a new server
/usr/local/ffmpeg-php/ffmpeg_movie.c:42:32: error: libavcodec/version.h: No such file or directory
Do you have any resolvent?
nian0408@foxmail.com
This is my Email, contact me please! Thank you
The php version is 5.4.15, 5.3.28 is fine!
You are GOD thaaaaaaaaaaaaaanks.
Since https://github.com/tony2001/ffmpeg-php.git is broken with current versions of ffmpeg (https://github.com/tony2001/ffmpeg-php/issues/14) I fixed it in a fork:
https://github.com/pbek/ffmpeg-php
(of course I also made a pull request)
Thanks Patrizio, I have modified the git url now:)