Question
How to install the ffmpeg-php extension in Plesk?
Answer
ffmpeg-php extension can be installed for PHP 5.6 provided by Plesk only. It cannot be installed for PHP 7.x provided by Plesk due to conflicts with Zend.
Follow the next steps to install ffmpeg-php extension for PHP 5.6 provided by Plesk on Plesk Obsidian CentOS 7 or Plesk Obsidian Ubuntu 16.04:
-
Log in to Plesk
-
Install Composer extension from Plesk extension catalog in Extensions:
-
Go to Domains > example.com > File Manager and create a file named
composer.json
with the content below:{
"require": {
"php-ffmpeg/php-ffmpeg": "^0.14.0"
}
}Note: The domain example.com is the domain where ffmpeg-php is going to be used
-
Go to Domains > example.com > PHP Settings and select 5.6.40, click OK
-
Go to Domains > example.com > PHP Composer click Install under Package Dependencies.
Note: the
ffmpeg-php
is installed in/var/www/vhosts/example.com/httpdocs/vendor/php-ffmpeg
directory. -
If Scan button appears in the popup, press it.
-
To start using php-ffmpeg add the below to the website code in a PHP page to load the library:
require 'vendor/autoload.php';
Additional information
ffmpeg-php extension is not pre-installed in Plesk. If you would like to see ffmpeg-php pre-installed in PHP provided by Plesk, please vote for this feature on Plesk UserVoice.