Last updated on April 4th, 2024 at 05:31 am
Before continuing to install FFmpeg-PHP, you will require to install FFmpeg codec.
To install it you can follow the tutorial here : Installing FFmpeg
Now for installtion of FFmpeg-PHP give the following commands :
svn co https://svn.sourceforge.net/svnroot/ffmpeg-php/trunk/ffmpeg-php
cd ffmpeg-php
phpize
./configure
make
make install
Now you will get output something like the :
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20070922
So remember to adjust the following linebased on what you see as your php path (as it may be different). Here we are using the following path which we found in previous line:
cp /usr/local/php/lib/php/extensions/no-debug-non-zts-20070922/ffmpeg.so /usr/local/php/lib/php/extensions/ffmpeg.so
Now open your php.ini file
php -i | grep ini
Once you have the file open it with an editor, here we will use nano.
nano /usr/local/php/lib/php.ini
In this file Find: extension_dir=
Set your path in this line, using our example it would be like :
extension_dir=”/usr/local/php/lib/extensions”
Now scroll to the end of the file and add
extension = ffmpeg.so
Save the file and exit.
You will now have FFmpeg installed, to verify run the following command:
php -i | grep ffmpeg
You will get output regarding ffmpeg
Installation is complete now restart your webserver for the changes to take effect.
{ 1 comment… read it below or add one }
Hi,
When I run ./configure, getting the following error message. Tried to google it but it didn’t help me.
checking for ffmpeg headers…
configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the –enable-shared option
Could you please advice?
Thank you