views:

2880

answers:

10

I need to install the ffmpeg PHP extension on my localhost so I can test few of my scripts but I am having troubles figuring out how to do that.

I have WampServer 2.0 with PHP 5.2.9-2, my OS is Windows XP. Please somebody give me step by step instructions.

I have found some Windows builds here: http://sourceforge.net/projects/ffmpeg-php/files/

But I don't know which one to download and what to do with files.

EDITED:

What I have done so far:

  1. Download ffmpeg_new
  2. Copy php_ffmpeg.dll from the php5 folder to the C:\wamp\bin\php\php5.2.9-2\ext
  3. Copy files from common to the windows/system32 folder
  4. Add extension=php_ffmpeg.dll to php.ini file
  5. Restarted all services (Apache, PHP...)

I am gettings an error after using this code:

            $extension = 'ffmpeg';
            $extension_soname = 'php_ffmpeg.dll';
            $extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname;

            // load extension
            if(false === extension_loaded($extension)) {
                if (false === dl($extension_soname))
                    throw new Exception("Can't load extension $extension_fullname\n");
            }

The error:

Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=ffmpeg.dll in your php.ini in C:\wamp\www\hunnyhive\application\modules\default\controllers\MyAccountController.php on line 314

Plus I also get the exception from above.

+1  A: 
  1. Download ffmpeg_new
  2. Copy php_ffmpeg.dll from the php5 folder to the wamp/php/ext folder
  3. Copy files from common to the windows/system32 folder
DDRBoxman
I have done that and also added extension=php_ffmpeg.dll to php.ini. But it still doesn't work, I'm going to edit my first post to contain error message.
Richard Knop
+1  A: 

Doesn't look like the problem is with ffmpeg... the warning is about the use of the dl function. Multi-threaded PHP does not support dynamic loading of any PHP extension, so you'll need to make sure the .dll file for it is placed wherever the rest of your php modules live.

What you really need to figure out is why the extension doesn't load despite the fact you've got the "extension=php_ffmpeg.dll" directive in your php.ini. Usually you can see any startup errors in your apache error log (such as PHP saying it can't load a library). Also, have you taken a look at a phpinfo() and verified ffmpeg isn't present (shouldn't be since the extension_loaded returns false), but perhaps it's there under a different name (you could also use get_loaded_extensions() I suppose).

Ian Selby
I have checked the phpinfo() and the ffmpeg isn't there, so it's not loaded even though the dll file is in correct folder and it is enabled in php.ini. There is nothing in Apache error logs related to this problem but PHP error logs are full of the error message from my first post.
Richard Knop
I have a feeling the problem is with the dll file, maybe it's compiled for older version of PHP? But I haven't found any other ffmpeg Windows builds on the Internet.
Richard Knop
Yeah, I've personally never installed FFMPEG on anything but Ubuntu boxes... if I had a windows box to test on I'd give it a whack, but I dunno what else to tell you other than try to build it yourself :)
Ian Selby
+3  A: 
  1. Download compiled dlls from here: http://sergey89.ru/files/ffmpeg-php-win32-all.zip
  2. Extract and put php_ffmpeg.dll to you php ext folder
  3. Put the rest of dlls to you windows/system32 folder
  4. Restart apache and run phpinfo() - you should see the ffmpeg extension (btw you have to check php not apache error log if you are looking for errors wamp->php->php error log)
works for php 5.2.0
HyperCas
A: 

^ tried, worked for me no problem.

running php5.2

Daniel
A: 

I am tired of searching new API version of ffmpeg . While starting apache it give following warning message.

PHP Startup: ffmpeg: Unable to initialize module Module compiled with module API=20060613 PHP compiled with module API=20090626. These options need to match.

How can make ffmpeg work in my Apache??? Please help me.. Thanks in advance.

Pramod Poudel

Pramod Poudel
A: 

MirKo is correct but i'll like to add that

after

  1. Download compiled dlls from here: http://sergey89.ru/files/ffmpeg-php-win32-all.zip
  2. Extract and put php_ffmpeg.dll to you php ext folder
  3. Put the rest of dlls to you windows/system32 folder
  4. Restart apache and run phpinfo() - you should see the ffmpeg extension (btw you have to check php not apache error log if you are looking for errors wamp->php->php error log)

there is another step

  • Open php.ini file and find ; extension=msql.dll
    add after it
    extension=php_ffmpeg.dll
  • Muhammad Hasnain
    A: 

    Can anyone tell the newbie the easy steps to get this program worked. I'm interested, but I don't know where to start.

    Where is the common folder. There is non of such sub-folder in the downloaded folder. There is no php sub-folder in the wamp folder.

    Please anyone successful with this program tell me step by step.

    ket
    A: 

    i have follow all these steps but ffmpeg not install and not listed in phpinfo().i am using Wamp 2.0 with windows xp.any one have idea what i did wrong plzzzzzzzzzzzzzzzzz.thanx in advance!

    Scorpians
    A: 

    http://sergey89.ru/files/ffmpeg-php-win32-all.zip

    1. unpack ffmpeg-php-win32-all.zip
    2. Copying php_ffmpeg.dll to the \wamp\php4\extension\ (for php5 it's \wamp\bin\php\ext)
    3. Copying avcodec.dll & avformat.dll and any other in package to the \windows\system32\
    4. Editing \wamp\apache\apache2.xx\bin\php.ini - adding line extension=php_ffmpeg.dll
    5. Restarting Apache.
    ganjar
    A: 

    Editing \wamp\apache\apache2.xx\bin\php.ini - adding line extension=php_ffmpeg.dll

    INSTEAD OF

    Editing \wamp\bin\php\php5.2.9\php.ini - adding line extension=php_ffmpeg.dll

    shen