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

Follow

Comments

12 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

Please sign in to leave a comment.

Have more questions? Submit a request