Installation
Get started with PHP FacturaE in your project by following these simple steps.Requirements
PHP Version
Required PHP Extensions
The following extensions must be enabled in your PHP installation:ext-openssl
Required for XAdES-EPES digital signatures and certificate handling
ext-dom
Required for XML generation and manipulation
These are standard PHP extensions and are typically enabled by default in most PHP installations.
Installing via Composer
Verify installation
After installation completes, verify the package is in your
composer.json:composer.json
Verifying Your Setup
Create a test script to ensure everything is installed correctly:verify.php
Autoloading
PHP FacturaE uses PSR-4 autoloading. The namespace mapping is:composer.json
PhpFacturae\Invoicemaps tosrc/Invoice.phpPhpFacturae\Partymaps tosrc/Party.phpPhpFacturae\Entities\Linemaps tosrc/Entities/Line.php- And so on…
After requiring the Composer autoloader (
vendor/autoload.php), all classes are automatically available — no manual imports needed.Development Dependencies
If you plan to contribute or run tests, install dev dependencies:- PHPUnit 11.0+ — For running the test suite
- PHPStan 2.0+ — For static analysis at level 8
Running Tests
Running Static Analysis
Troubleshooting
”ext-openssl is missing”
On Ubuntu/Debian:php.ini and uncomment:
“ext-dom is missing”
On Ubuntu/Debian:php.ini and uncomment:
“Class ‘PhpFacturae\Invoice’ not found”
If the error persists, regenerate the autoloader:Optional: TSA Timestamping
For timestamp authority (TSA) support when signing invoices, you may needext-curl:
TSA timestamping is optional but recommended for long-term signature validity. See the Signing documentation for details.
Next Steps
Quickstart Guide
Create your first complete invoice in under 5 minutes
API Reference
Explore the full API documentation
Create your first invoice
Head to the Quickstart guide to generate a complete working invoice