Insall ffmpeg-php on Debian Squeeze

2011-07-28 by xpheas
I compiled PHP5.3 from the php.net sources, so there is no apt ffmpeg-php binary package available for my PHP setup and i build it myself.

First we need the ffmpeg package and some devel packages:
BASH-Code:
1
apt-get install ffmpeg libswscale0 libswscale-dev libavcodec-dev libavformat-dev

On Squeeze some needed header files are not located under /usr/local/include/ffmpeg so we need to copy them.
BASH-Code:
1
2
3
4
5
mkdir -p /usr/local/include/ffmpeg
cp /usr/include/libswscale/swscale.h /usr/local/include/ffmpeg/
cp /usr/include/libavformat/avformat.h /usr/local/include/ffmpeg/
cp /usr/include/libavformat/avio.h /usr/local/include/ffmpeg/
cp /usr/include/libavcodec/avcodec.h /usr/local/include/ffmpeg/

Now we cand download and install ffmpeg-php:
BASH-Code:
1
2
3
4
5
6
7
cd /tmp/
wget http://surfnet.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2
tar xfvj ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0
/usr/bin/php5-cgi/phpize
./configure --with-php-config=/usr/bin/php5-cgi/php-config
cp /tmp/ffmpeg-php-0.6.0/modules/ffmpeg.so /usr/share/php5-cgi/extensions/

To use the extension include it in your php.ini
BASH-Code:
1
extension=ffmpeg.so

or load it in your php script:
BASH-Code:
1
dl('ffmpeg.so');

  « back

Feel Free to Leave a Comment

Name:*


Email: (not visible)


Website:


Comment:*