You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows 7 Laragon环境下编译PHP 7.1 php-xxhash扩展可行性及方法咨询

Absolutely, it’s totally feasible to get the php-xxhash extension up and running with PHP 7.1 on your Windows 7 Laragon setup. Let me walk you through the exact steps to make this happen smoothly:

Step 1: Confirm your PHP 7.1’s key details first
  • Fire up Laragon, head to the top menu > PHP > Version to ensure you’re actively using PHP 7.1.
  • Click the Terminal button in Laragon to open a command prompt, then run this command:
    php -i | findstr "Architecture Thread Safety"
    
  • Jot down two things: whether your PHP is x86 or x64, and if Thread Safety (TS) is enabled or disabled (NTS). This is non-negotiable—you need an extension build that matches both exactly.
Step 2: Grab the correct php-xxhash build for PHP 7.1
  • The official repo doesn’t ship pre-built Windows binaries for PHP 7.1, so you’ve got two options:
    1. Compile the extension yourself (doable but a bit tedious on Windows—you’ll need the PHP SDK and a compiler like Visual Studio 2015, since PHP 7.1 uses that toolchain).
    2. Find a trusted pre-compiled php_xxhash.dll that matches your PHP’s architecture and thread safety status. Stick to reputable sources to avoid malware.
Step 3: Install the extension into Laragon’s PHP folder
  • Navigate to your Laragon PHP 7.1 directory (default path is usually C:\laragon\bin\php\php-7.1.x—replace x with your exact minor version number).
  • Locate the ext subfolder inside, then copy your downloaded php_xxhash.dll into it.
Step 4: Enable the extension in php.ini
  • In Laragon, go to menu > PHP > php.ini to open the configuration file.
  • Scroll down to the section where extensions are listed (look for lines starting with extension=).
  • Add a new line at the end of that section:
    extension=php_xxhash.dll
    
    (For PHP 7.1, using the full filename is safer than the shorter extension=xxhash.dll syntax.)
  • Save the php.ini file once you’re done.
Step 5: Verify the extension is working
  • Restart Laragon’s web server (Apache or Nginx, whichever you’re using) via the top menu > [Server Name] > Restart.
  • Open the Laragon terminal again and run:
    php -m | findstr xxhash
    
    If you see xxhash pop up in the output, you’re good to go!
  • Alternatively, create a quick test file named info.php in Laragon’s www folder with this code:
    <?php phpinfo(); ?>
    
    Access it via your browser (like http://localhost/info.php) and search for "xxhash"—you should see a dedicated section confirming the extension is loaded.
Quick troubleshooting tips
  • If the extension fails to load, double-check that your php_xxhash.dll matches your PHP’s architecture (x86/x64) and thread safety status (TS/NTS). Mismatches here are the #1 culprit.
  • Ensure the DLL file isn’t corrupted—try re-downloading it if you suspect issues.
  • Check Laragon’s error logs (menu > Logs > Apache Error Log) for specific error messages; they’ll usually tell you exactly what’s wrong.

内容的提问来源于stack exchange,提问作者Paolo_Mulder

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 04:08:31