Skip to content

Comments

Fix Windows extension install from downloads.php.net zip (eg apcu/apcu)#511

Closed
GhostPirateBob wants to merge 6 commits intophp:1.4.xfrom
GhostPirateBob:1.4.x
Closed

Fix Windows extension install from downloads.php.net zip (eg apcu/apcu)#511
GhostPirateBob wants to merge 6 commits intophp:1.4.xfrom
GhostPirateBob:1.4.x

Conversation

@GhostPirateBob
Copy link

G'day folks!

This is my first contribution to this repo, so please let me know if there’s a preferred way to structure things.

I had a weird issue on Windows with the latest nightly and 1.3.8 stable where pie install apcu/apcu didn't work, even though there was a valid zip file and dll for my version.

Turns out it was just because of inconsistent file naming between GitHub releases, php.net releases and the dll name inside the zip file. So I did my best to try and write (somewhat Windows specific) fallbacks. Worked for me, I've not tested it super thoroughly on MacOS and Linux, but my Windows code should be fairly well scoped to that OS.

Cheers!

gpb
✌(◕‿-)✌

Summary of changes

  • Generate asset name variants for "x64" arch (not just "x86_64") and versions without "v" prefix
  • Add Architecture::windowsName() for conventional Windows arch labels
  • Fall back to downloads.php.net/~windows/pecl/releases/ when GitHub release has no matching Windows binary
  • Support simple DLL naming (e.g. "php_apcu.dll") used in downloads.php.net zips

Output Logs

  • powershell output of error on latest nightly:
> php pie-1.4.x-nightly.phar install apcu/apcu

🥧 PHP Installer for Extensions (PIE) 1.3.8@adfe984, from The PHP Foundation
This command may need elevated privileges, and may prompt you for your password.
You are running PHP 8.5.1
Target PHP installation: 8.5.1 ts, vs17, on Windows x86_64 (from C:\FlyEnv\PhpWebStudy-Data\env\php\php.exe)
Found package: apcu/apcu:v5.1.28 which provides ext-apcu

In CouldNotDetermineDownloadUrlMethod.php line 31:

  Could not download apcu/apcu using windows-binary method: Windows archive with prebuilt extension for apcu/apcu was not attached on release v5.1.28 - looked for one of "php_apcu-v5.1.28-8.5-ts-vs17-x86_64.zip, php_apcu-v5.1.28-8.5-vs17-ts-x86_64.zip"
  • powershell output after fixing url on latest nightly:
> php pie-1.4.x-gpb.phar install apcu/apcu

🥧 PHP Installer for Extensions (PIE) 1.4.x-gpb@592fa53, from The PHP Foundation
This command may need elevated privileges, and may prompt you for your password.
You are running PHP 8.5.1
Target PHP installation: 8.5.1 ts, vs17, on Windows x86_64 (from C:\FlyEnv\PhpWebStudy-Data\env\php\php.exe)
Found package: apcu/apcu:v5.1.28 which provides ext-apcu
Found prebuilt archive: https://downloads.php.net/~windows/pecl/releases/apcu/5.1.28/php_apcu-5.1.28-8.5-ts-vs17-x64.zip
Extracted apcu/apcu:v5.1.28 source to: C:\Users\xxxx\AppData\Roaming\PIE\php8.5_3075acc559022f4dac70c73363ddadb2\vendor/apcu/apcu

In WindowsExtensionAssetName.php line 104:

  Unable to find DLL for package, checked: php_apcu-v5.1.28-8.5-ts-vs17-x86_64.dll, php_apcu-v5.1.28-8.5-vs17-ts-x86_64.dll, php_apcu-v5.1.28-8.5-ts-vs17-x64.dll, php_apcu-v5.1.28-8.5-vs17-ts-x64.dll, php_apcu-5.1.28-8.5-ts-vs17-x86_64.dll, php_apcu-5.1.28-8.5-vs17-ts-x86_64.dll, php_apcu-5.1.28-8.5-ts-vs17-x64.dll, php_apcu-5.1.28-8.5-vs17

Screenshots (both issues and after fix)

2026-02-18 23_26_27- 2026-02-18 23_27_31- 2026-02-18 23_50_44-

- Generate asset name variants for "x64" arch (not just "x86_64") and versions without "v" prefix
- Add Architecture::windowsName() for conventional Windows arch labels
- Fall back to downloads.php.net/~windows/pecl/releases/ when GitHub release has no matching Windows binary
- Support simple DLL naming (e.g. "php_apcu.dll") used in downloads.php.net zips
@GhostPirateBob GhostPirateBob force-pushed the 1.4.x branch 2 times, most recently from cbc0e8e to b608c0d Compare February 19, 2026 17:34
GhostPirateBob and others added 4 commits February 20, 2026 01:34
  Zlib 1.3.2 changed its output names. The library files are now named z.lib, z.dll, and zs.lib instead of the old zlib.lib, zlib.dll, and zlibstatic.lib that SPC expects.
  SPC's zlib.php builder tries to:
  1. Copy zlibstatic.lib — doesn't exist (it's zs.lib now)
  2. Delete zlib.dll — doesn't exist (it's z.dll now)
  3. Delete zlib.lib — doesn't exist (it's z.lib now)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GhostPirateBob
Copy link
Author

GhostPirateBob commented Feb 19, 2026

closing to split this into two issues/PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant