# Installation
Requirements
PHP FacturaE requires PHP 8.2 or higher.
Required PHP extensions:
ext-openssl— Required for XAdES-EPES digital signatures and certificate handlingext-dom— Required for XML generation and manipulation
Install via Composer
composer require php-facturae/php-facturaeVerify the installation
<?php
require_once 'vendor/autoload.php';
use PhpFacturae\Invoice;use PhpFacturae\Party;
$invoice = Invoice::create('TEST-001') ->seller(Party::company('B12345678', 'Test Company')) ->buyer(Party::company('B87654321', 'Client Company')) ->line('Test product', price: 100.00, vat: 21);
echo "✓ PHP FacturaE is correctly installed!\n";echo "Invoice number: " . $invoice->getNumber() . "\n";Autoloading
PHP FacturaE uses PSR-4 autoloading:
PhpFacturae\Invoicemaps tosrc/Invoice.phpPhpFacturae\Partymaps tosrc/Party.phpPhpFacturae\Entities\Linemaps tosrc/Entities/Line.php
Development dependencies
composer install --devIncludes PHPUnit 11.0+ and PHPStan 2.0+ (level 8).
# Run testsvendor/bin/phpunit
# Run static analysisvendor/bin/phpstan analyse src --level=8Troubleshooting
“ext-openssl is missing” — Install php8.2-openssl (Ubuntu/Debian) or enable it in php.ini (Windows).
“ext-dom is missing” — Install php8.2-xml (Ubuntu/Debian).
“Class ‘PhpFacturae\Invoice’ not found” — Make sure you include vendor/autoload.php. Run composer dump-autoload if needed.
Optional: TSA time-stamping
For time-stamping authority (TSA) support, you will need ext-curl:
sudo apt-get install php8.2-curl