How to install the ffmpeg-php extension in Plesk for CentOS 7

Follow

Comments

17 comments

  • Avatar
    Carsten Sachse

    Hello Alexandr, it’s possible to install it for php 7? cause all my scripts are working now with php 7.

    Regards
    Carsten

    0
    Comment actions Permalink
  • Avatar
    Denis Bykov

    @Carsten Sachse

    Unfortunately, it cannot be compiled due to conflicts with Zend, which is included in PHP 7.0 shipped with Plesk:

    error: too many arguments to function 'zend_hash_find'

    You may try to add custom PHP version and to install FFmpeg module for it.

    0
    Comment actions Permalink
  • Avatar
    Unknown User

    ffmpeg is installed but script cant find it here /usr/bin/ffmpeg 

    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Sohail Khan
    Hi!
    Please check whether 'ffmpeg_path' is specified in the script and that it is pointing to /usr/bin/ffmpeg.
    Check that ffmpeg is in place:
    # whereis ffmpeg
    ffmpeg: /usr/bin/ffmpeg /usr/include/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
    And check that permissions on /usr/bin/ffmpeg are 755 root:root.

    0
    Comment actions Permalink
  • Avatar
    Sharul Hafiz

    # For a single website, the 'composer' can be used instead. See the command below for the installation and the following link for usage examples: https://github.com/PHP-FFMpeg/PHP-FFMpeg 

    any guide on how to do this on specific subscription?

    0
    Comment actions Permalink
  • Avatar
    VAV

    Hi Alex,

    I follow this : /opt/plesk/php/7.2/bin/php /usr/lib64/plesk-9.0/composer.phar install php-ffmpeg/php-ffmpeg 

    But get bellow error: 

    Do not run Composer as root/super user! See https://getcomposer.org/root for details

    Invalid argument php-ffmpeg/php-ffmpeg. Use "composer require php-ffmpeg/php-ffmpeg" instead to add packages to your composer.json.

    Please help.

     

     

    0
    Comment actions Permalink
  • Avatar
    Nikita Nikushkin

    Hello @Sharul Hafiz,

    PHP extension cannot be installed for a single website, only for the whole PHP

    However, as soon as you installed it to some specific PHP version, select this PHP for the domain:

    How to change PHP version for a domain in Plesk?

    I also removed incorrect information from the article. Thank you for pointing that out!

    0
    Comment actions Permalink
  • Avatar
    Nikita Nikushkin

    Hello @VAV

    The "composer install" does not require specifying packages (the same info can be found here)

    Thus, the correct command will be the next:

    # /opt/plesk/php/7.2/bin/php /usr/lib64/plesk-9.0/composer.phar install

    However, if you would like to add the mentioned packages to the "composer.json" file, use the next command (the same info can be found here):

    /opt/plesk/php/7.2/bin/php /usr/lib64/plesk-9.0/composer.phar require php-ffmpeg/php-ffmpeg 

    Additional information about Composer CLI can be found here:

    Composer Documentation | CLI

    0
    Comment actions Permalink
  • Avatar
    Ion Iacob

    We install successful with 7.3 php version and work fine. Thanks for Nikita.

    We have this error in final: https://www.codepile.net/pile/YxRyXjMn

     

    0
    Comment actions Permalink
  • Avatar
    Nikita Nikushkin

    Hi @Ion Iacob,

    One point here: you successfully installed the ffmpeg-php extension for PHP 7.3

    OR

    The following error appears:

    make: *** [ffmpeg_movie.lo] Error 1

    in an attempt to run this command:

    # make clean && make && make install

    ?

    0
    Comment actions Permalink
  • Avatar
    Ion Iacob

    The ffmpeg-php works, but after executing this # make clean && make && make install it gave the errors that I shared.

    The extension is not displayed in Plesk at Tools & Settings> PHP Settings> PHP 7.3

    0
    Comment actions Permalink
  • Avatar
    Nikita Nikushkin

    Hi @Ion Iacob,

    Reproduced the same errors on my test environment

    It happens when steps 6.1, 6.2 and 6.3 were skipped

    Please edit the ffmpeg_frame.c file as it suggested in these steps and follow steps 7, 8 and 9 further

    If the issue still occurs, please repeat all steps from the beginning one more time in order to make sure that nothing was missed

    0
    Comment actions Permalink
  • Avatar
    Mark Tierney

    Hi is there still no solution to this?

    I have an application that required ffmpeg and php7.2 or later.

    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Mark Tierney

    You may install a custom 7.2 PHP version and install ffmpeg-php for it.

    0
    Comment actions Permalink
  • Avatar
    Mark Tierney

    Thanks, so far everything seems to be working fine on the normal php 7.2 version.

    I followed these instructions:

    yum install epel-release
    yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
    yum install ffmpeg ffmpeg-devel


    Then installed the ffmpeg php packages via composer.

    I had to add the paths for ffmpeg and ffprobe to the open_basedir path in my php settings and all works fine thanks.

     

    0
    Comment actions Permalink
  • Avatar
    duy

    It seems that the application I am using it cannot receive the ffmpeg path when it already has extenson in php5.6. Although it does recognize, it will error is not recognized.

    # whereis ffmpeg
    ffmpeg: /usr/bin/ffmpeg /usr/include/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz

    i use /usr/bin/ffmpeg.I had to switch from cpanel to plesk because it responds too slowly, but ffmpeg seems to be very difficult to install.

    0
    Comment actions Permalink
  • Avatar
    Ekaterina Babenko

    Hello,

    As mentioned in the article the ffmpeg is not supported currently and all steps are given as a reference. If there some issues with that I suggest you to review the available sources on the possible cause.

    In addition you may get in touch with our Professional Service team and discuss possibility of extension installation on paid basis:
    https://www.plesk.com/professional-services/

    Also I encourage you to share vote for implementing this functionality on our Uservoice portal:
    https://plesk.uservoice.com/forums/184549-feature-suggestions/suggestions/13114461

    You are more than welcome to share your opinion in comment section.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request