How to install FFMpeg in WampServer 2.0 (Windows X

2019-01-13 11:31发布

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.

7条回答
做自己的国王
2楼-- · 2019-01-13 12:07

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

  1. Open php.ini file and find ; extension=msql.dll
    add after it
    extension=php_ffmpeg.dll
查看更多
不美不萌又怎样
3楼-- · 2019-01-13 12:15

add this line to your php.ini file

[PHP_ffmpeg]
extension=php_ffmpeg.dll
查看更多
Melony?
4楼-- · 2019-01-13 12:15

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

查看更多
姐就是有狂的资本
5楼-- · 2019-01-13 12:18

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

查看更多
一纸荒年 Trace。
6楼-- · 2019-01-13 12:21
  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
查看更多
时光不老,我们不散
7楼-- · 2019-01-13 12:23

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.
查看更多
登录 后发表回答