n5s / wp-symfony-local-server
Fixes WordPress compatibility issues when running on Symfony Local Server with local domain names
Installs: 130
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/n5s/wp-symfony-local-server
Requires
- php: ^8.2
- n5s/wp-hook-kit: ^1.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.37
- mantle-framework/testkit: ^1.16
- php-stubs/wordpress-stubs: ^6.7
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- symplify/easy-coding-standard: ^13.0
- szepeviktor/phpstan-wordpress: ^2.0
README
Fixes WordPress compatibility issues when running on Symfony Local Server with local domains (.wip).
Installation
composer require n5s/wp-symfony-local-server --dev
That's it. The library auto-detects Symfony Local Server and registers the necessary hooks.
What it fixes
| Problem | Solution |
|---|---|
Self-requests fail (SSL errors, unresolved .wip TLD) |
Routes them through Symfony's proxy with proper certificates |
/wp-admin/ causes redirect loops |
Rewrites to /wp-admin/index.php (why?) |
| Redirect caching issues | Uses HTTP 302 instead of 301 for admin redirects |
How it works
The library only activates when it detects Symfony Local Server (via SERVER_SOFTWARE header or ~/.symfony5/proxy.json config). It then:
- Sets
WP_PROXY_HOSTandWP_PROXY_PORTto route internal requests through Symfony's proxy - Provides Symfony's root CA certificate for SSL verification
- Hooks into
admin_urlandredirect_canonicalto fix admin URL handling
Requirements
- PHP 8.2+
- Symfony CLI with local proxy configured