Learn about Centmin Mod LEMP Stack today
Become a Member

[Solved] Unable to install FFMPEG PHP extension

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

  1. Guneyd

    Guneyd New Member

    11
    2
    3
    Jun 1, 2014
    Ratings:
    +2
    Local Time:
    3:07 AM
    Hello,

    I've setup the most recent (stable) version of the centmin mod, but I'm unable to install FFMPEG. I thought upgrading PHP might be the solution, so I upgraded it twice (once to 5.5 and then to 5.6). But even after selecting the option to install ffmpeg in the menu, it still doesn't work. FFMPEG doesn't show up in my phpinfo.php and when I do nprestart, I get the following error msg:

    Code:
    [root@high centmin-v1.2.3mod]# nprestart
    [0929/221649:INFO:google_message_handler.cc(35)] No threading detected. Own threads: 1 Rewrite, 1 Expensive Rewrite.
    nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
    Stopping nginx:                                            [  OK  ]
    Starting nginx: [0929/221650:INFO:google_message_handler.cc(35)] No threading detected. Own threads: 1 Rewrite, 1 Expensive Rewrite.
                                                               [  OK  ]
    Gracefully shutting down php-fpm . done
    Starting php-fpm [29-Sep-2014 22:16:51] 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
    [29-Sep-2014 22:16:51] NOTICE: PHP message: PHP Warning:  PHP Startup: newrelic: Unable to initialize module
    Module compiled with module API=20100525
    PHP    compiled with module API=20131226
    These options need to match
    in Unknown on line 0
    done
    [root@high centmin-v1.2.3mod]#
    


     
  2. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    11:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    FFMPEG menu doesn't work with PHP 5.5/5.6 so that is as expected.

    .07 and higher versions should of prevented the install via the menu if it detected PHP versions 5.5/5.6 from line 7 of inc/ffmpeginstall.inc

    which version of Centmin Mod you using ? if it's .07 stable then FFMPEG menu doesn't work with PHP 5.5/5.6

    edit: I see the problem I needed double square brackets on line 7 to prevent FFMPEG from even running if PHP 5.5/5.6 is detected

    edit: the ffmpeg-php issues summarized at [Solved] - Unable to install FFMPEG PHP extension | Page 4 | Centmin Mod Community

    edit: and [Solved] - Unable to install FFMPEG PHP extension | Page 4 | Centmin Mod Community

    updated: Patrizio contributed fixes [Solved] - Unable to install FFMPEG PHP extension | Page 4 | Centmin Mod Community
     
    Last edited: Aug 1, 2016
  3. Guneyd

    Guneyd New Member

    11
    2
    3
    Jun 1, 2014
    Ratings:
    +2
    Local Time:
    3:07 AM
    Ah I see. That would make a lot of sense haha. To what version of PHP should I downgrade in your opinion, would 5.4.32 make it work?
    Thank you.
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    11:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah PHP 5.4.33 should work
     
  5. Guneyd

    Guneyd New Member

    11
    2
    3
    Jun 1, 2014
    Ratings:
    +2
    Local Time:
    3:07 AM
    I've downgraded to PHP Version 5.4.32, but I still can't install FFMPEG.
    It says:

    " 5.4 not compatible with FFMPEG-PHP
    install aborted"

    Do I have to downgrade to 5.3 or is this a bug?
     
  6. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    11:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    on your live Centmin Mod server, edit line 7 of inc/ffmpeginstall.inc as shown in the link to have double square brackets and see
    Code:
    if [[ "$PHPVERCHECK" != '5.4' ]]; then
     
  7. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    11:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    doh i remember now, FFMPEG doesn't work with PHP version 5.4 and higher so 5.4-5.6 no go. So yes PHP 5.3.29 is more likely needed

    error you get when trying to compile FFMPEG on PHP >=5.4
    Code:
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie___construct’:
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c:311: error: ‘list_entry’ undeclared (first use in this function)
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c:311: error: (Each undeclared identifier is reported only once
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c:311: error: for each function it appears in.)
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c:311: error: ‘le’ undeclared (first use in this function)
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c:346: error: expected ‘;’ before ‘new_le’
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c:356: error: ‘new_le’ undeclared (first use in this function)
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘_php_read_av_frame’:
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c:1215: warning: ‘avcodec_decode_video’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3452)
    make: *** [ffmpeg_movie.lo] Error 1
    
    Bug report is old ffmpeg-php extension / Bugs / #52 Will not compile against PHP 5.4
     
    Last edited: Sep 30, 2014
  8. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    11:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    @Guneyd might have found the fix for ffmpeg PHP extension proper error free compile for PHP versions >=5.4. You can try this out if you want

    step 1. on your server which you installed Centmin Mod go and change line 7 of inc/ffmpeginstall.inc to the following to disable the version check
    Code:
    if [[ "$PHPVERCHECK" != '5.8' ]]; then
    then change wget line from
    Code:
    wget -c --progress=bar http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/${FFMPEGVER}/ffmpeg-php-${FFMPEGVER}.tbz2?use_mirror=aarnet --tries=3
    to
    Code:
    wget -c --progress=bar http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/${FFMPEGVER}/ffmpeg-php-${FFMPEGVER}.tbz2?use_mirror=aarnet -O ffmpeg-php-${FFMPEGVER}.tbz2 --tries=3
    step 2. need to manually patch /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c file for fixes so do following commands
    Code:
    cd /svr-setup
    FFMPEGVER=0.6.0
    wget -c --progress=bar http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/${FFMPEGVER}/ffmpeg-php-${FFMPEGVER}.tbz2?use_mirror=aarnet -O ffmpeg-php-${FFMPEGVER}.tbz2 --tries=3
    tar -xjf ffmpeg-php-${FFMPEGVER}.tbz2
    cd /svr-setup/ffmpeg-php-0.6.0
    wget -O ffmpeg.patch https://gist.github.com/centminmod/b3cd8785bed2a87c7ba8/raw/ffmpeg.patch
    patch < ffmpeg.patch
    step 3. then run centmin.sh menu option 19 and see if ffmpeg PHP extension compiles and loads. I tested this on PHP 5.4.33 and it worked
    Code:
    php --ri ffmpeg
    
    ffmpeg
    
    ffmpeg-php version => 0.6.0-svn
    ffmpeg-php built on => Sep 29 2014 00:06:37
    ffmpeg-php gd support  => enabled
    ffmpeg libavcodec version => Lavc52.72.2
    ffmpeg libavformat version => Lavf52.64.2
    ffmpeg swscaler version => SwS0.11.0
    
    Directive => Local Value => Master Value
    ffmpeg.allow_persistent => 0 => 0
    ffmpeg.show_warnings => 0 => 0
     
    Last edited: Sep 30, 2014
  9. Guneyd

    Guneyd New Member

    11
    2
    3
    Jun 1, 2014
    Ratings:
    +2
    Local Time:
    3:07 AM
    Thank you for the help eva2000, but you lost me at step 2. I don't have a folder named /svr-setup/, do I need to manually download ffmpeg first? And I don't know whether it makes a difference, but I also didn't have inc/ffmpeg.inc, it was named inc/ffmpeginstall.inc instead (I did manage to edit that file).
     
  10. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    11:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    /svr-setup is on your server you installed Centmin Mod, that is where you have to edit the files in step 2

    sorry inc/ffmpeginstall.inc i meant
     
  11. Guneyd

    Guneyd New Member

    11
    2
    3
    Jun 1, 2014
    Ratings:
    +2
    Local Time:
    3:07 AM
  12. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    11:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    you didn't patch the required file, when do these 3 commands show for output on your server via SSH
    Code:
    cd /svr-setup/ffmpeg-php-0.6.0
    wget -O ffmpeg.patch https://gist.github.com/centminmod/b3cd8785bed2a87c7ba8/raw/ffmpeg.patch
    patch < ffmpeg.patch
     
  13. Guneyd

    Guneyd New Member

    11
    2
    3
    Jun 1, 2014
    Ratings:
    +2
    Local Time:
    3:07 AM
    The same as before:
    Code:
    [root@high ffmpeg-php-0.6.0]# patch < ffmpeg.patch
    patching file ffmpeg_movie.c
    patch unexpectedly ends in middle of line
    Hunk #3 succeeded at 357 with fuzz 1.
    
     
  14. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    11:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    that is correct patch output for working compile, just tested again with PHP 5.4.33 without problems

    Code:
    --2014-09-30 12:51:08--  http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=aarnet
    Resolving downloads.sourceforge.net... 216.34.181.59
    Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: http://aarnet.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2 [following]
    --2014-09-30 12:51:09--  http://aarnet.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2
    Resolving aarnet.dl.sourceforge.net... 202.158.214.107, 2001:388:30bc:cafe::c0de
    Connecting to aarnet.dl.sourceforge.net|202.158.214.107|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 275557 (269K) [application/octet-stream]
    Saving to: “ffmpeg-php-0.6.0.tbz2”
    
         0K .......... .......... .......... .......... .......... 18%  950K 0s
        50K .......... .......... .......... .......... .......... 37% 2.96M 0s
       100K .......... .......... .......... .......... .......... 55% 2.14M 0s
       150K .......... .......... .......... .......... .......... 74% 4.42M 0s
       200K .......... .......... .......... .......... .......... 92% 3.16M 0s
       250K .......... .........                                  100% 2.28M=0.1s
    
    2014-09-30 12:51:10 (2.08 MB/s) - “ffmpeg-php-0.6.0.tbz2” saved [275557/275557]
    
    --2014-09-30 12:51:10--  https://gist.github.com/centminmod/b3cd8785bed2a87c7ba8/raw/ffmpeg.patch
    Resolving gist.github.com... 192.30.252.140
    Connecting to gist.github.com|192.30.252.140|:443... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: https://gist.githubusercontent.com/centminmod/b3cd8785bed2a87c7ba8/raw/ffmpeg.patch [following]
    --2014-09-30 12:51:11--  https://gist.githubusercontent.com/centminmod/b3cd8785bed2a87c7ba8/raw/ffmpeg.patch
    Resolving gist.githubusercontent.com... 192.30.252.158
    Connecting to gist.githubusercontent.com|192.30.252.158|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [text/plain]
    Saving to: “ffmpeg.patch”
    
         0K .                                                      8.95M=0s
    
    2014-09-30 12:51:12 (8.95 MB/s) - “ffmpeg.patch” saved [1156]
    
    patching file ffmpeg_movie.c
    patch unexpectedly ends in middle of line
    Hunk #3 succeeded at 357 with fuzz 1.
    make: *** No rule to make target `clean'.  Stop.
    Configuring for:
    PHP Api Version:         20100412
    Zend Module Api No:      20100525
    Zend Extension Api No:   220100525
    Configuring for:
    PHP Api Version:         20100412
    Zend Module Api No:      20100525
    Zend Extension Api No:   220100525
    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 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 ccache gcc accepts -g... yes
    checking for ccache gcc option to accept ISO C89... none needed
    checking how to run the C preprocessor... ccache gcc -E
    checking for icc... no
    checking for suncc... no
    checking whether ccache gcc and cc understand -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/local
    checking for PHP includes... -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
    checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20100525
    checking for PHP installed headers prefix... /usr/local/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... ...found in /usr/include/libavcodec
    checking for ffmpeg libavcodec.so... ...found in /usr/lib64
    checking for ffmpeg swscale support... yes
    checking for ld used by ccache gcc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for /usr/bin/ld option to reload object files... -r
    checking for BSD-compatible nm... /usr/bin/nm -B
    checking whether ln -s works... yes
    checking how to recognize dependent libraries... pass_all
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking dlfcn.h usability... yes
    checking dlfcn.h presence... yes
    checking for dlfcn.h... yes
    checking the maximum length of command line arguments... 1966080
    checking command to parse /usr/bin/nm -B output from ccache gcc object... ok
    checking for objdir... .libs
    checking for ar... ar
    checking for ranlib... ranlib
    checking for strip... strip
    checking if ccache gcc supports -fno-rtti -fno-exceptions... no
    checking for ccache gcc option to produce PIC... -fPIC
    checking if ccache gcc PIC flag -fPIC works... yes
    checking if ccache gcc static flag -static works... yes
    checking if ccache gcc supports -c -o file.o... yes
    checking whether the ccache gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    
    creating libtool
    appending configuration tag "CXX" to libtool
    checking whether the ccache g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking for ccache g++ option to produce PIC...
    checking if ccache g++ static flag  works... yes
    checking if ccache g++ supports -c -o file.o... yes
    checking whether the ccache g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking dynamic linker characteristics... GNU/Linux ld.so
    (cached) (cached) checking how to hardcode library paths into programs... unsupported
    configure: creating ./config.status
    config.status: creating config.h
    /bin/sh /svr-setup/ffmpeg-php-0.6.0/libtool --mode=compile ccache gcc  -I. -I/svr-setup/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-0.6.0/include -I/svr-setup/ffmpeg-php-0.6.0/main -I/svr-setup/ffmpeg-php-0.6.0 -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/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/  -DHAVE_CONFIG_H  -g -O2 -Wall -fno-strict-aliasing   -c /svr-setup/ffmpeg-php-0.6.0/ffmpeg-php.c -o ffmpeg-php.lo
    /bin/sh /svr-setup/ffmpeg-php-0.6.0/libtool --mode=compile ccache gcc  -I. -I/svr-setup/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-0.6.0/include -I/svr-setup/ffmpeg-php-0.6.0/main -I/svr-setup/ffmpeg-php-0.6.0 -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/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/  -DHAVE_CONFIG_H  -g -O2 -Wall -fno-strict-aliasing   -c /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c -o ffmpeg_movie.lo
    /bin/sh /svr-setup/ffmpeg-php-0.6.0/libtool --mode=compile ccache gcc  -I. -I/svr-setup/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-0.6.0/include -I/svr-setup/ffmpeg-php-0.6.0/main -I/svr-setup/ffmpeg-php-0.6.0 -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/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/  -DHAVE_CONFIG_H  -g -O2 -Wall -fno-strict-aliasing   -c /svr-setup/ffmpeg-php-0.6.0/ffmpeg_frame.c -o ffmpeg_frame.lo
    mkdir .libs
    ccache gcc -I. -I/svr-setup/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-0.6.0/include -I/svr-setup/ffmpeg-php-0.6.0/main -I/svr-setup/ffmpeg-php-0.6.0 -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/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /svr-setup/ffmpeg-php-0.6.0/ffmpeg_frame.c  -fPIC -DPIC -o .libs/ffmpeg_frame.o
    ccache gcc -I. -I/svr-setup/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-0.6.0/include -I/svr-setup/ffmpeg-php-0.6.0/main -I/svr-setup/ffmpeg-php-0.6.0 -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/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /svr-setup/ffmpeg-php-0.6.0/ffmpeg-php.c  -fPIC -DPIC -o .libs/ffmpeg-php.o
    ccache gcc -I. -I/svr-setup/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-0.6.0/include -I/svr-setup/ffmpeg-php-0.6.0/main -I/svr-setup/ffmpeg-php-0.6.0 -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/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c  -fPIC -DPIC -o .libs/ffmpeg_movie.o
    /bin/sh /svr-setup/ffmpeg-php-0.6.0/libtool --mode=compile ccache gcc  -I. -I/svr-setup/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-0.6.0/include -I/svr-setup/ffmpeg-php-0.6.0/main -I/svr-setup/ffmpeg-php-0.6.0 -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/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/  -DHAVE_CONFIG_H  -g -O2 -Wall -fno-strict-aliasing   -c /svr-setup/ffmpeg-php-0.6.0/ffmpeg_errorhandler.c -o ffmpeg_errorhandler.lo
    ccache gcc -I. -I/svr-setup/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-0.6.0/include -I/svr-setup/ffmpeg-php-0.6.0/main -I/svr-setup/ffmpeg-php-0.6.0 -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/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /svr-setup/ffmpeg-php-0.6.0/ffmpeg_errorhandler.c  -fPIC -DPIC -o .libs/ffmpeg_errorhandler.o
    /bin/sh /svr-setup/ffmpeg-php-0.6.0/libtool --mode=compile ccache gcc  -I. -I/svr-setup/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-0.6.0/include -I/svr-setup/ffmpeg-php-0.6.0/main -I/svr-setup/ffmpeg-php-0.6.0 -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/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/  -DHAVE_CONFIG_H  -g -O2 -Wall -fno-strict-aliasing   -c /svr-setup/ffmpeg-php-0.6.0/ffmpeg_tools.c -o ffmpeg_tools.lo
    ccache gcc -I. -I/svr-setup/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-0.6.0/include -I/svr-setup/ffmpeg-php-0.6.0/main -I/svr-setup/ffmpeg-php-0.6.0 -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/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /svr-setup/ffmpeg-php-0.6.0/ffmpeg_tools.c  -fPIC -DPIC -o .libs/ffmpeg_tools.o
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_tools.c: In function ‘ffmpeg_img_convert’:
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_tools.c:79: warning: passing argument 2 of ‘sws_scale’ from incompatible pointer type
    /usr/include/libswscale/swscale.h:195: note: expected ‘const uint8_t * const*’ but argument is of type ‘uint8_t **’
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘_php_read_av_frame’:
    /svr-setup/ffmpeg-php-0.6.0/ffmpeg_movie.c:1215: warning: ‘avcodec_decode_video’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3452)
    /bin/sh /svr-setup/ffmpeg-php-0.6.0/libtool --mode=link ccache gcc -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-0.6.0/include -I/svr-setup/ffmpeg-php-0.6.0/main -I/svr-setup/ffmpeg-php-0.6.0 -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/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/  -DHAVE_CONFIG_H  -g -O2 -Wall -fno-strict-aliasing   -o ffmpeg.la -export-dynamic -avoid-version -prefer-pic -module -rpath /svr-setup/ffmpeg-php-0.6.0/modules  ffmpeg-php.lo ffmpeg_movie.lo ffmpeg_frame.lo ffmpeg_errorhandler.lo ffmpeg_tools.lo -Wl,-rpath,/usr/lib64 -L/usr/lib64 -lswscale -Wl,-rpath,/usr/lib64 -L/usr/lib64 -lavformat -Wl,-rpath,/usr/lib64 -L/usr/lib64 -lavcodec
    ccache gcc -shared  .libs/ffmpeg-php.o .libs/ffmpeg_movie.o .libs/ffmpeg_frame.o .libs/ffmpeg_errorhandler.o .libs/ffmpeg_tools.o  -L/usr/lib64 -lswscale -lavformat -lavcodec  -Wl,-rpath -Wl,/usr/lib64 -Wl,-rpath -Wl,/usr/lib64 -Wl,-rpath -Wl,/usr/lib64 -Wl,-soname -Wl,ffmpeg.so -o .libs/ffmpeg.so
    creating ffmpeg.la
    (cd .libs && rm -f ffmpeg.la && ln -s ../ffmpeg.la ffmpeg.la)
    /bin/sh /svr-setup/ffmpeg-php-0.6.0/libtool --mode=install cp ./ffmpeg.la /svr-setup/ffmpeg-php-0.6.0/modules
    cp ./.libs/ffmpeg.so /svr-setup/ffmpeg-php-0.6.0/modules/ffmpeg.so
    cp ./.libs/ffmpeg.lai /svr-setup/ffmpeg-php-0.6.0/modules/ffmpeg.la
    PATH="$PATH:/sbin" ldconfig -n /svr-setup/ffmpeg-php-0.6.0/modules
    ----------------------------------------------------------------------
    Libraries have been installed in:
       /svr-setup/ffmpeg-php-0.6.0/modules
    
    If you ever happen to want to link against installed libraries
    in a given directory, LIBDIR, you must either use libtool, and
    specify the full pathname of the library, or use the `-LLIBDIR'
    flag during linking and do at least one of the following:
       - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
         during execution
       - add LIBDIR to the `LD_RUN_PATH' environment variable
         during linking
       - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
       - have your system administrator add LIBDIR to `/etc/ld.so.conf'
    
    See any operating system documentation about shared libraries for
    more information, such as the ld(1) and ld.so(8) manual pages.
    ----------------------------------------------------------------------
    
    Build complete.
    Don't forget to run 'make test'.
    
    Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20100525/
    
    FFMPEG PHP extension installed..
    restarting php-fpm service ...
    
    service php-fpm restart
    Gracefully shutting down php-fpm . done
    Starting php-fpm  done
    
    check phpinfo for FFMPEG PHP Extension...
    
    ffmpeg
    ffmpeg-php version => 0.6.0-svn
    ffmpeg-php built on => Sep 30 2014 12:51:17
    ffmpeg-php gd support  => enabled
    ffmpeg libavcodec version => Lavc52.72.2
    ffmpeg libavformat version => Lavf52.64.2
    ffmpeg swscaler version => SwS0.11.0
    ffmpeg.allow_persistent => 0 => 0
    ffmpeg.show_warnings => 0 => 0
    
    check FFMPEG
    
    FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
      built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)
      configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
      libavutil     50.15. 1 / 50.15. 1
      libavcodec    52.72. 2 / 52.72. 2
      libavformat   52.64. 2 / 52.64. 2
      libavdevice   52. 2. 0 / 52. 2. 0
      libavfilter    1.19. 0 /  1.19. 0
      libswscale     0.11. 0 /  0.11. 0
      libpostproc   51. 2. 0 / 51. 2. 0
     
  15. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    11:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    try deleting existing /svr-setup/ffmpeg* directory and files and redoing steps 1 to 3 with a few changes below
    Code:
    rm -rf /svr-setup/ffmpeg*
    cd /svr-setup
    FFMPEGVER=0.6.0
    wget -c --progress=bar http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/${FFMPEGVER}/ffmpeg-php-${FFMPEGVER}.tbz2?use_mirror=aarnet -O ffmpeg-php-${FFMPEGVER}.tbz2 --tries=3
    tar -xjf ffmpeg-php-${FFMPEGVER}.tbz2
    cd /svr-setup/ffmpeg-php-0.6.0
    wget -O ffmpeg.patch https://gist.github.com/centminmod/b3cd8785bed2a87c7ba8/raw/ffmpeg.patch
    patch < ffmpeg.patch
    
    then run centmin.sh menu option 19
     
    Last edited: Sep 30, 2014
  16. Guneyd

    Guneyd New Member

    11
    2
    3
    Jun 1, 2014
    Ratings:
    +2
    Local Time:
    3:07 AM
    I finally got it to work.

    What I did was manually edit the ffmpeg_movie.c file. And afterwards I followed the following instructions:
    Code:
    cd ffmpeg-php-0.6.0
    phpize
    ./configure
    make
    make install
    There was already a reference in the php.ini file and it now also shows up in phpinfo.php :).
    Thank you for your help eva2000!
     
  17. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    11:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    You're welcome
     
  18. Markus

    Markus New Member

    2
    0
    1
    Apr 20, 2015
    Ratings:
    +0
    Local Time:
    3:07 AM
     
  19. Matt

    Matt Well-Known Member

    928
    415
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +671
    Local Time:
    2:07 AM
    1.5.15
    MariaDB 10.2
    Just tried installing ffmpeg before finding this thread. Should it have errored out before trying to install given I'm using PHP5.6?

    Code:
    --------------------------------------------------------
    Enter option [ 1 - 24 ] 19
    --------------------------------------------------------
    FFMPEG install starting...
    Package libvpx-1.3.0-5.el7_0.x86_64 already installed and latest version
    Package libvpx-devel-1.3.0-5.el7_0.x86_64 already installed and latest version
    Error: ffmpeg-php-0.6.0.tbz2 not found!!! Downloading now......
    --2015-07-15 14:59:11--  http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=aarnet
    Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59
    Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:80... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: http://skylink.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2 [following]
    --2015-07-15 14:59:11--  http://skylink.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2
    Resolving skylink.dl.sourceforge.net (skylink.dl.sourceforge.net)... 109.230.212.53
    Connecting to skylink.dl.sourceforge.net (skylink.dl.sourceforge.net)|109.230.212.53|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 275557 (269K) [application/octet-stream]
    Saving to: ‘ffmpeg-php-0.6.0.tbz2’
    
         0K .......... .......... .......... .......... .......... 18% 1.46M 0s
        50K .......... .......... .......... .......... .......... 37% 2.71M 0s
       100K .......... .......... .......... .......... .......... 55% 2.80M 0s
       150K .......... .......... .......... .......... .......... 74%  782K 0s
       200K .......... .......... .......... .......... .......... 92% 11.2M 0s
       250K .......... .........                                  100% 11.6M=0.1s
    
    2015-07-15 14:59:11 (1.89 MB/s) - ‘ffmpeg-php-0.6.0.tbz2’ saved [275557/275557]
    
    make: *** No rule to make target `clean'.  Stop.
    Configuring for:
    PHP Api Version:         20131106
    Zend Module Api No:      20131226
    Zend Extension Api No:   220131226
    Configuring for:
    PHP Api Version:         20131106
    Zend Module Api No:      20131226
    Zend Extension Api No:   220131226
    --2015-07-15 14:59:13--  https://gist.github.com/centminmod/b3cd8785bed2a87c7ba8/raw/ffmpeg.patch
    Resolving gist.github.com (gist.github.com)... 192.30.252.140
    Connecting to gist.github.com (gist.github.com)|192.30.252.140|:443... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: https://gist.githubusercontent.com/centminmod/b3cd8785bed2a87c7ba8/raw/ffmpeg.patch [following]
    --2015-07-15 14:59:14--  https://gist.githubusercontent.com/centminmod/b3cd8785bed2a87c7ba8/raw/ffmpeg.patch
    Resolving gist.githubusercontent.com (gist.githubusercontent.com)... 23.235.43.133
    Connecting to gist.githubusercontent.com (gist.githubusercontent.com)|23.235.43.133|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 1156 (1.1K) [text/plain]
    Saving to: ‘ffmpeg.patch’
    
         0K .                                                     100%  273M=0s
    
    2015-07-15 14:59:14 (273 MB/s) - ‘ffmpeg.patch’ saved [1156/1156]
    
    patching file ffmpeg_movie.c
    patch unexpectedly ends in middle of line
    Hunk #3 succeeded at 357 with fuzz 1.
    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 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 ccache gcc accepts -g... yes
    checking for ccache gcc option to accept ISO C89... none needed
    checking how to run the C preprocessor... ccache gcc -E
    checking for icc... no
    checking for suncc... no
    checking whether ccache gcc and cc understand -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/local
    checking for PHP includes... -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
    checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20131226
    checking for PHP installed headers prefix... /usr/local/include/php
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for re2c... re2c
    checking for re2c version... 0.14.3 (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
    make: *** No targets specified and no makefile found.  Stop.
    make: *** No rule to make target `install'.  Stop.
    
    FFMPEG PHP extension installed..
    restarting php-fpm service ...
    
    service php-fpm restart
    Gracefully shutting down php-fpm . done
    Starting php-fpm [15-Jul-2015 14:59:16] 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
    done
    
    check phpinfo for FFMPEG PHP Extension...
    
    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
    
    check FFMPEG
    
    inc/ffmpeginstall.inc: line 61: ffmpeg: command not found
     
  20. Matt

    Matt Well-Known Member

    928
    415
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +671
    Local Time:
    2:07 AM
    1.5.15
    MariaDB 10.2
    Code:
    [root@dev ffmpeg-php-0.6.0]# yum -y install ffmpeg ffmpeg-devel mplayer mencoder flvtool2 re2c yasm nasm libvpx libvpx-devel amrnb-devel amrwb-devel libid3tag libvorbis-devel lame libogg libwmf xvidcore xvidcore-devel facc faad2 a52decoder *vorbis* ruby ruby-libs ruby-devel
    Loaded plugins: fastestmirror, priorities
    Loading mirror speeds from cached hostfile
    * base: centos.serverspace.co.uk
    * epel: mirrors.coreix.net
    * extras: centos.serverspace.co.uk
    * rpmforge: www.mirrorservice.org
    * updates: mirrors.coreix.net
    149 packages excluded due to repository priority protections
    No package ffmpeg available.
    No package ffmpeg-devel available.
    No package mplayer available.
    No package mencoder available.
    No package flvtool2 available.
    Package yasm-1.2.0-4.el7.x86_64 already installed and latest version
    Package nasm-2.10.07-7.el7.x86_64 already installed and latest version
    Package libvpx-1.3.0-5.el7_0.x86_64 already installed and latest version
    Package libvpx-devel-1.3.0-5.el7_0.x86_64 already installed and latest version
    No package amrnb-devel available.
    No package amrwb-devel available.
    Package libid3tag-0.15.1b-17.el7.x86_64 already installed and latest version
    Package 1:libvorbis-devel-1.3.3-8.el7.x86_64 already installed and latest version
    No package lame available.
    Package 2:libogg-1.3.0-7.el7.x86_64 already installed and latest version
    Package libwmf-0.2.8.4-39.el7.x86_64 already installed and latest version
    No package xvidcore available.
    No package xvidcore-devel available.
    No package facc available.
    No package faad2 available.
    No package a52decoder available.
    Package 1:vorbis-tools-1.4.0-12.el7.x86_64 already installed and latest version
    Package 1:libvorbis-devel-1.3.3-8.el7.x86_64 already installed and latest version
    Package 1:libvorbis-devel-docs-1.3.3-8.el7.noarch already installed and latest version
    Package 1:libvorbis-1.3.3-8.el7.x86_64 already installed and latest version
    Package mingw32-libvorbis-1.3.4-1.el7.noarch already installed and latest version
    Package mingw64-libvorbis-1.3.4-1.el7.noarch already installed and latest version
    Package ruby-2.0.0.598-25.el7_1.x86_64 already installed and latest version
    Package ruby-libs-2.0.0.598-25.el7_1.x86_64 already installed and latest version
    Package ruby-devel-2.0.0.598-25.el7_1.x86_64 already installed and latest version
    Nothing to do
    [root@dev ffmpeg-php-0.6.0]#