How to install FFMpeg in WampServer 2.0 (Windows XP)

25,377

Solution 1

add this line to your php.ini file

[PHP_ffmpeg]
extension=php_ffmpeg.dll

Solution 2

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.

Solution 3

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

Solution 4

; Whether or not to enable the dl() function.  The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_dl = Off

These are the lines in php.ini. Make sure that enable_dl is turned off. After that you will not get error.

Solution 5

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).

Share:
25,377
Richard Knop
Author by

Richard Knop

I'm a software engineer mostly working on backend from 2011. I have used various languages but has been mostly been writing Go code since 2014. In addition, I have been involved in lot of infra work and have experience with various public cloud platforms, Kubernetes, Terraform etc. For databases I have used lot of Postgres and MySQL but also Redis and other key value or document databases. Check some of my open source projects: https://github.com/RichardKnop/machinery https://github.com/RichardKnop/go-oauth2-server https://github.com/RichardKnop

Updated on July 30, 2022

Comments

  • Richard Knop
    Richard Knop almost 2 years

    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.

  • Richard Knop
    Richard Knop almost 15 years
    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
    Richard Knop almost 15 years
    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
    Richard Knop almost 15 years
    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.
  • Ian Selby
    Ian Selby almost 15 years
    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 :)
  • shasi kanth
    shasi kanth almost 13 years
    You may also need to enable the extension: php_gd2.dll;
  • user3833682
    user3833682 over 7 years
  • user3833682
    user3833682 over 7 years
  • user3833682
    user3833682 over 7 years
  • user3833682
    user3833682 over 7 years
  • user3833682
    user3833682 over 7 years
  • user3833682
    user3833682 over 7 years
  • user3833682
    user3833682 over 7 years