Shared PHP-FFMPEG

Discussion in 'ISPConfig 3 Priority Support' started by budgierless, Sep 12, 2015.

  1. budgierless

    budgierless Member HowtoForge Supporter

    Hi,

    I have installed multiple versions of PHP on my server based on the ispconfig documents tutorials for ubuntu, also adding apc, geoip etc. but i would like to also install php-ffmpeg for each PHP version individually or as an shard extension.
    please not that the default system PHP has its own php-ffpmeg ubuntu repository version already installed so i want to avoid conflicts with that.
    Also note that the ffmpeg i have on my server was compiled by source and not using the ubuntu repository version.
    please tell me if i should do it another way but for now I'm thinking the steps i will use maybe are:
    1. Download the latest ffmpeg-php release
    2. Extract the archive:
      tar -xjf ffmpeg-php-X.x.x.tbz2
    3. cd ffmpeg-php-X.x.x/
    4. phpize
    5. ./configure && make
    6. sudo make install
    But I think the key area where i need help is how you use ./configure with the right prefix for shared or individual use if that is the only possible method?
    please advise
    thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You will have to set the path to the config of the right php version.

    From PHP manual comments of the phpize command:

    http://php.net/manual/en/install.pecl.phpize.php

    There are some other comments that might related to this on that page.
     
  3. budgierless

    budgierless Member HowtoForge Supporter

    Are you saying I have to install the multiple php versions again adding --with-php-config= ?
    or install php-ffmpeg adding --with-php-config= ?

    with the php-ffmpeg, can i install that as:
    ./configure \
    --enable-shared \
    --prefix=/usr/local/php-ffmpeg/

    then reinstall multiple php versions adding? --with-php-ffmpeg= /usr/local/php-ffmpeg/

    would that work for a shared method?

    or if for individual, do i have to install php-ffmpeg multiple times in each /opt/php-xxx/php-ffmpeg then add --with-php-ffmpeg= /opt/php-5.xxx/bin/php-config ?
     
    Last edited: Sep 13, 2015
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Install php-ffmpeg with the config setting. I never installed that add on, so I can't say of the shared option will work. Try it and you will see.
     
  5. budgierless

    budgierless Member HowtoForge Supporter

    Solved: installed on each php version using:
    ./configure \
    --prefix=/opt/ffmpeg-php/ \
    --with-ffmpeg=/usr/local/cpffmpeg \
    --with-php-config=/opt/php-5XXX/bin/php-config
     
    Last edited: Sep 15, 2015
  6. budgierless

    budgierless Member HowtoForge Supporter

    The next part of this issue I have is this error:

    PHP Warning: PHP Startup: ffmpeg: Unable to initialize module
    Module compiled with module API=20090626
    PHP compiled with module API=20121212
    These options need to match


    Dose the build location matter for the method i am using?, please advise how to fix this.
     
  7. budgierless

    budgierless Member HowtoForge Supporter

    UPDATE: Solved = tested and works
    ffmpeg-php had to be compiled under the same directory that the version of php that you want to use is made from, then ran the following updated command process to install on each version.

    phpize
    ./configure \
    --prefix=/usr/local/src/php5-build/php-5.XXX/ffmpeg-php \
    --with-ffmpeg=/usr/local/cpffmpeg \
    --with-php-config=/opt/php-5.XXX/bin/php-config
    make
    make install

    PLEASE NOTE: I have to download ffmpeg-php from https://github.com/jbboehr/ffmpeg-php because that version has been updated to work with newer versions of PHP.
     
    till likes this.

Share This Page