Welcome to Centmin Mod Community
Register Now

[Solved] Unable to install FFMPEG PHP extension

Discussion in 'Bug Reports' started by Guneyd, Sep 30, 2014.

  1. RoldanLT

    RoldanLT Well-Known Member

    4,157
    1,007
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,421
    Local Time:
    3:54 PM
    1.11
    10.2
    Got this error with CentOS 7.4 and PHP 5.6
    Code:
    NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/ffmpeg.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/ffmpeg.so: cannot open shared object file: No such file or directory in Unknown on line 0

     
  2. eva2000

    eva2000 Administrator Staff Member

    33,667
    7,454
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,459
    Local Time:
    5:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    haven't tested routine in ages so who knows

    should have ffmpeg install log in /root/centminlogs you can gist/pastebin
     
  3. eva2000

    eva2000 Administrator Staff Member

    33,667
    7,454
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,459
    Local Time:
    5:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    FYI, ffmpeg-php extension is broken again.. probably without fix.

    in Centmin Mod 123.09beta01 latest updated code managed to fix ffmpeg binary install routine but ffmpeg-php extension is no more it seems it fails to compile with latest ffmpeg binary as ffmpeg-php developer has abandoned updates :(

    relevant updates
    so update to latest 123.09beta01 before re-running centmin.sh menu option 19 submenu option 1

    Upgrading Centmin Mod Code to Latest Version



    Getting Started Guide step 19 outlines also how to keep Centmin Mod code updated or how to switch version branches or you can run cmupdate command that was recently added.

    Centmin Mod LEMP stack's script code is constantly updated for improvements, bug fixes and security fixes so keeping the Centmin Mod code up to date is important. With Centmin Mod 1.2.3-eva2000.08) (123.08stable) and higher releases, a newly added centmin.sh menu option 23 allows much easier code updates and version branch swicthing via Git backed environment you can setup. For full details read the following links:
    Upgrading Centmin Mod involves 2 parts.
    1. Upgrading the actual Centmin Mod code outlined at Upgrade Centmin Mod. This is heart of Centmin Mod where the code is the engine that runs centmin.sh shell based menu and all the automation you're accustomed to. You can easily update within a Centmin Mod version branch or switch version branches via centmin.sh menu option 23 outlined here.
    2. Upgrade software that Centmin Mod installed or manages. For this part following outline at How to upgrade Centmin Mod software installed on your server.
    FYI, here's actual ffmpeg-php extension compilation errors if anyone was curious and/or has the coding chops to fork the ffmpeg-php extension code at tony2001 (Antony Dovgal) · GitHub and code fixes/updates to work with latest ffmpeg binaries.
    Code (Text):
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_stream_index’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:146:17: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
                     GET_CODEC_FIELD(fmt_ctx->streams[i]->codec, codec_type) == type) {
                     ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_decoder_context’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:479:9: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
             decoder = avcodec_find_decoder(GET_CODEC_FIELD(
             ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:490:13: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
                 GET_CODEC_PTR(ffmovie_ctx->fmt_ctx->streams[stream_index]->codec);
                 ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_framerate’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:638:5: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
         if (GET_CODEC_FIELD(st->codec, codec_type) == AVMEDIA_TYPE_VIDEO){
         ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:642:13: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
                 rate = 1 / av_q2d(GET_CODEC_FIELD(st->codec, time_base));
                 ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_framewidth’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:718:5: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
         return GET_CODEC_FIELD(st->codec, width);
         ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_frameheight’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:746:5: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
         return GET_CODEC_FIELD(st->codec, height);
         ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_codec_name’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:921:27: error: ‘AVCodecContext’ has no member named ‘codec_name’
         } else if (decoder_ctx->codec_name[0] != '\0') {
                               ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:922:33: error: ‘AVCodecContext’ has no member named ‘codec_name’
             codec_name = decoder_ctx->codec_name;
                                     ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_read_av_frame’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1171:11: warning: assignment makes pointer from integer without a cast [enabled by default]
         frame = avcodec_alloc_frame();
               ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1177:13: warning: ‘avcodec_decode_video2’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:4664) [-Wdeprecated-declarations]
                 avcodec_decode_video2(decoder_ctx, frame, &got_frame, &packet);
                 ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1182:17: warning: ‘av_free_packet’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:4336) [-Wdeprecated-declarations]
                     av_free_packet(&packet);
                     ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1188:9: warning: ‘av_free_packet’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:4336) [-Wdeprecated-declarations]
             av_free_packet(&packet);
             ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_ff_frame’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1294:28: warning: assignment makes pointer from integer without a cast [enabled by default]
             ff_frame->av_frame = avcodec_alloc_frame();
                                ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1295:9: warning: ‘avpicture_alloc’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:5303) [-Wdeprecated-declarations]
             avpicture_alloc((AVPicture*)ff_frame->av_frame, ff_frame->pixel_format,
             ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1301:9: warning: ‘av_picture_copy’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:5336) [-Wdeprecated-declarations]
             av_picture_copy((AVPicture*)ff_frame->av_frame,
             ^
    /svr-setup/ffmpeg-php-git/ffmpeg_frame.c: In function ‘_php_convert_frame’:
    /svr-setup/ffmpeg-php-git/ffmpeg_frame.c:215:5: warning: ‘avpicture_alloc’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:5303) [-Wdeprecated-declarations]
         avpicture_alloc((AVPicture*)dst_frame, dst_fmt, ff_frame->width,
         ^
    /svr-setup/ffmpeg-php-git/ffmpeg_frame.c: In function ‘_php_resample_frame’:
    /svr-setup/ffmpeg-php-git/ffmpeg_frame.c:515:5: warning: ‘avpicture_alloc’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:5303) [-Wdeprecated-declarations]
         avpicture_alloc((AVPicture*)resampled_frame, AV_PIX_FMT_YUV420P,
         ^
    make: *** [ffmpeg_movie.lo] Error 1
    make: *** Waiting for unfinished jobs....
    /bin/sh /svr-setup/ffmpeg-php-git/libtool --mode=compile ccache gcc  -I. -I/svr-setup/ffmpeg-php-git -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-git/include -I/svr-setup/ffmpeg-php-git/main -I/svr-setup/ffmpeg-php-git -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -I/opt/ffmpeg/include -DHAVE_CONFIG_H  -g -O2   -c /svr-setup/ffmpeg-php-git/ffmpeg_movie.c -o ffmpeg_movie.lo 
     ccache gcc -I. -I/svr-setup/ffmpeg-php-git -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-git/include -I/svr-setup/ffmpeg-php-git/main -I/svr-setup/ffmpeg-php-git -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/opt/ffmpeg/include -DHAVE_CONFIG_H -g -O2 -c /svr-setup/ffmpeg-php-git/ffmpeg_movie.c  -fPIC -DPIC -o .libs/ffmpeg_movie.o
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_stream_index’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:146:17: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
                     GET_CODEC_FIELD(fmt_ctx->streams[i]->codec, codec_type) == type) {
                     ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_decoder_context’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:479:9: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
             decoder = avcodec_find_decoder(GET_CODEC_FIELD(
             ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:490:13: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
                 GET_CODEC_PTR(ffmovie_ctx->fmt_ctx->streams[stream_index]->codec);
                 ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_framerate’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:638:5: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
         if (GET_CODEC_FIELD(st->codec, codec_type) == AVMEDIA_TYPE_VIDEO){
         ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:642:13: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
                 rate = 1 / av_q2d(GET_CODEC_FIELD(st->codec, time_base));
                 ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_framewidth’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:718:5: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
         return GET_CODEC_FIELD(st->codec, width);
         ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_frameheight’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:746:5: warning: ‘codec’ is deprecated (declared at /opt/ffmpeg/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
         return GET_CODEC_FIELD(st->codec, height);
         ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_codec_name’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:921:27: error: ‘AVCodecContext’ has no member named ‘codec_name’
         } else if (decoder_ctx->codec_name[0] != '\0') {
                               ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:922:33: error: ‘AVCodecContext’ has no member named ‘codec_name’
             codec_name = decoder_ctx->codec_name;
                                     ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_read_av_frame’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1171:11: warning: assignment makes pointer from integer without a cast [enabled by default]
         frame = avcodec_alloc_frame();
               ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1177:13: warning: ‘avcodec_decode_video2’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:4664) [-Wdeprecated-declarations]
                 avcodec_decode_video2(decoder_ctx, frame, &got_frame, &packet);
                 ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1182:17: warning: ‘av_free_packet’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:4336) [-Wdeprecated-declarations]
                     av_free_packet(&packet);
                     ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1188:9: warning: ‘av_free_packet’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:4336) [-Wdeprecated-declarations]
             av_free_packet(&packet);
             ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_ff_frame’:
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1294:28: warning: assignment makes pointer from integer without a cast [enabled by default]
             ff_frame->av_frame = avcodec_alloc_frame();
                                ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1295:9: warning: ‘avpicture_alloc’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:5303) [-Wdeprecated-declarations]
             avpicture_alloc((AVPicture*)ff_frame->av_frame, ff_frame->pixel_format,
             ^
    /svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1301:9: warning: ‘av_picture_copy’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:5336) [-Wdeprecated-declarations]
             av_picture_copy((AVPicture*)ff_frame->av_frame,
             ^
    make: *** [ffmpeg_movie.lo] Error 1
    grep: /etc/centminmod/php.d/ffmpeg.ini: No such file or directory
    
     
..