Install php-ffmpeg on CentOS

The easy way to install php-ffmpeg. The following works for CentOS 5 and CentOS 6.

Install ffmpeg and ffmpeg-devel
# yum remove libvpx libogg libvorbis libtheora libx264 x264 ffmpeg
# rpm --import http://packages.atrpms.net/RPM-GPG-KEY.atrpms
# vim /etc/yum.repos.d/atrpms.repo

[atrpms]
name=Fedora Core $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=0

[atrpms-testing]
name=Fedora Core $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/testing
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=0

# yum --enablerepo=atrpms* install ffmpeg ffmpeg-devel

Install php-ffmpeg
Download php-ffmpeg from https://github.com/tony2001/ffmpeg-php then extract it on a folder. Or the easy way is using git if you have git installed:
$ git clone https://github.com/tony2001/ffmpeg-php.git
$ cd ffmpeg-php
Then install it:
# phpize
# ./configure
# make
# make install

Edit php.ini:
extension_dir=”/usr/local/lib/php/extensions/no-debug-non-zts-20060613″
extension=”ffmpeg.so”

Leave a Reply

Your email address will not be published. Required fields are marked *

*