Skip to content

Add xmlwriter and xmlreader extensions - #314

Open
KaWaiIhA wants to merge 1 commit into
NativePHP:mainfrom
KaWaiIhA:main
Open

Add xmlwriter and xmlreader extensions#314
KaWaiIhA wants to merge 1 commit into
NativePHP:mainfrom
KaWaiIhA:main

Conversation

@KaWaiIhA

Copy link
Copy Markdown

PhpSpreadsheet (a common library for reading/writing Excel files) requires
ext-xmlwriter unconditionally to write any .xlsx file — it's instantiated
directly throughout its writer code with no fallback. It's currently missing
from the default extension list, so any NativePHP app that writes Excel files
hits a fatal Class "XMLWriter" not found error when saving.

Adding xmlreader too, since PhpSpreadsheet lists it as a hard composer.json
requirement as well, even though my own use case only hit the xmlwriter gap.

Confirmed both are supported on Windows/Linux/macOS per static-php-cli's own
extension support table: https://static-php.dev/en/guide/extensions.html

@PeteBishwhip
PeteBishwhip self-requested a review July 24, 2026 09:04
@PeteBishwhip

Copy link
Copy Markdown
Member

Thanks for your contribution @KaWaiIhA.

We intentionally don't add extensions not natively required by Laravel to keep the binaries slim and our maintenance burden small.

We have documentation here on how you can build your own binaries with additional extensions for this reason:

https://nativephp.com/docs/desktop/2/digging-deeper/php-binaries

As your use case is for a third-party package, can I recommend you utilise this route instead? Unless there is a general need for an extension across the majority of the userbase, we tend to leave it for you to customise. :)

@KaWaiIhA

Copy link
Copy Markdown
Author

Thanks for your contribution @KaWaiIhA.

We intentionally don't add extensions not natively required by Laravel to keep the binaries slim and our maintenance burden small.

We have documentation here on how you can build your own binaries with additional extensions for this reason:

https://nativephp.com/docs/desktop/2/digging-deeper/php-binaries

As your use case is for a third-party package, can I recommend you utilise this route instead? Unless there is a general need for an extension across the majority of the userbase, we tend to leave it for you to customise. :)

Makes total sense, thanks for the quick response! I'll build a custom binary
following your docs instead. Closing this out.

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.

2 participants