简体   繁体   中英

Make errors when installing ffmpeg-php on RHEL 5.6

I've been trying to install ffmpeg-php v0.6.0 on RHEL (Redhat Enterprise Linux) 5.6 (Tikanga) environment. I'm running PHP Version 5.2.17 and have the following ffmpeg packages installed:

  • ffmpeg-0.6.5-1.el5.rf
  • ffmpeg-devel-0.6.5-1.el5.rf
  • ffmpeg-libpostproc-0.6.5-1.el5.rf

I've followed these installation instructions . I'm stuck on the step where I run make , I am getting the following errors:

In file included from /usr/include/sys/stat.h:105,
                 from /usr/include/php/main/php_streams.h:28,
                 from /usr/include/php/main/php.h:400,
                 from /usr/local/src/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/bits/stat.h:88: error: field 'st_atim' has incomplete type
/usr/include/bits/stat.h:89: error: field 'st_mtim' has incomplete type
/usr/include/bits/stat.h:90: error: field 'st_ctim' has incomplete type
/usr/include/bits/stat.h:149: error: field 'st_atim' has incomplete type
/usr/include/bits/stat.h:150: error: field 'st_mtim' has incomplete type
/usr/include/bits/stat.h:151: error: field 'st_ctim' has incomplete type
In file included from /usr/include/php/main/php.h:406,
                 from /usr/local/src/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/php/TSRM/tsrm_virtual_cwd.h:209: error: expected specifier-qualifier-list before 'time_t'
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg-php.c: In function 'zm_startup_ffmpeg':
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg-php.c:94: warning: implicit declaration of function 'avcodec_init'

Have been crawling the interwebs looking to see if others have encountered similar issues, so far I've found this which recommends to install an older version of ffmpeg-php.

I'm discontent with using older version of things, and was wondering if anyone else has encountered the errors above and has successfully resolved them, or if they can point me in the right direction to start resolving them.

After looking up for hours, it seems that time.h for some apparent reason has been used in ffmpeg 1.2.1 (this is what I tested). This caused conflict with the OS's own file of the same name.

While I cannot code in PHP (and can barely read PHP code), I have found a git repo maintained by tony2001 who has made changes to the original project and using his repo has helped me install it successfully on CentOS-6.2, CentOS-6.3 and CentOS-6.4 (Sorry I haven't tested these on any other flavour but I guess if it works on CentOS-6.4, it should work on RHEL 5.x and 6.x too)

You can find the repo here .

Hope this helps you in the future (and maybe someone else who lands up here eventually)

PS: Incidentally, at the time of writing this answer ffmpeg 2.0 has been released but I haven't got a chance to test it yet

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM