I have downloaded files from .
I add four files in c:\\windows\system32\ folder these files are : avcodec-51.dll, avformat-51.dll, avutil-49.dll and pthreadGC2.dll.
And one file php_ffmpeg.dll i add in \xampp\php\ext\ folder. After restarting system and server i get following error:

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

---------------------------
OK
---------------------------

Note I have xampp 1.4.7 and php version 5.3.5.
Can any body help me with full details?

Dani AI

Generated

Short answer: the ffmpeg PHP extension must be built for the exact same PHP build you are running. is correct that "they should match." has already hit the common symptom when they do not. Below is a concise, practical checklist and a couple of low-effort alternatives so the page helps people arriving later.

  1. Confirm exactly what your PHP build is (version, 32 vs 64 bit, thread-safety, and which Visual C++ runtime it was built with). Create a small file called phpinfo.php and open it in the browser to read those fields:

    <?php
    phpinfo();
    ?>
  2. Get a php_ffmpeg binary that matches all those details. Binary PHP extensions for Windows must match: PHP version, bitness (x86/x64), thread-safety (TS/NTS) and the same Visual C++ toolchain. If you cannot find a prebuilt DLL that matches, you have two practical options:

    • Build the extension yourself against your PHP build (requires matching Visual Studio, PHP SDK headers and some effort).
    • Use the official ffmpeg executable and call it from PHP (reliable and future-proof). Example:
    $cmd = 'ffmpeg -i "input.mp4" -ss 00:00:01 -vframes 1 thumb.jpg 2>&1';
    exec($cmd, $output, $return);
  3. Quick troubleshooting tips: check Apache/PHP error logs after restarting, use a dependency-inspection tool if a DLL fails to load (it will show missing VC runtimes), and verify the extension directory and extension= line in php.ini. Put dependent DLLs somewhere on the PATH or in the same folder as the PHP/Apache binary so Windows can find them.

Note: ffmpeg-php Windows builds have historically been spotty; using the ffmpeg CLI plus a PHP wrapper library is usually the simplest and most maintainable solution for new projects.

What version is that ffmpeg for? And what version of PHP are you running? Those should match.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.