- Can I use this package to install WordPress alongside Laravel in a shared public/ directory?
- No, this package is designed for custom paths like `web/edition/` or `public/wordpress/` to avoid conflicts with Laravel’s `public/` or `storage/` directories. Manually configure symlinks or server rules to route WordPress traffic through Laravel if needed.
- What Laravel versions does metabolism/wordpress-core-installer support?
- The package has no Laravel-specific constraints, but it requires PHP ≥7.2 (via johnpbloch/wordpress-core). Test thoroughly with Laravel 8.0+ to avoid path collisions with `bootstrap/cache/` or `vendor/` directories.
- How do I prevent WordPress core updates from breaking Laravel’s cached configurations?
- Run `php artisan config:clear` and `php artisan route:clear` after `composer update` to refresh Laravel’s cached configurations. Alternatively, pin WordPress versions in `composer.json` to avoid unexpected updates.
- Is this package safe for production? What about security risks?
- Yes, but WordPress core updates introduce risks like `.env` exposure or plugin vulnerabilities. Use `composer.lock` to pin versions, restrict WordPress admin access, and disable file editing in `wp-config.php` for production.
- How do I configure WordPress to use Laravel’s database and environment variables?
- Edit `wp-config.php` after installation to reference Laravel’s `.env` for credentials (e.g., `DB_HOST`, `DB_DATABASE`). Use Laravel’s `env()` helper or a custom Artisan command to sync configurations dynamically.
- Will this work with Laravel Forge or Envoyer for deployments?
- Yes, but ensure your deployment script runs `composer install` or `composer update` before Laravel’s `artisan optimize`. Test path permissions and symlinks in staging to avoid production issues.
- Can I install WordPress into Laravel’s `storage/app/public` directory?
- Not recommended. The `storage/` directory is for Laravel’s files, and WordPress may overwrite critical files. Use a custom path like `storage/wordpress/` and configure WordPress’s `upload_path` separately.
- What if I need to migrate an existing WordPress install to this setup?
- Backup your WordPress files and database first. Delete the old install, then run `composer require metabolism/wordpress-core-installer johnpbloch/wordpress-core` and configure `installer-paths` in `composer.json`. Restore files to the new path and update `wp-config.php`.
- Are there alternatives to this package for WordPress-Laravel integration?
- Yes. For headless setups, consider WP-CLI for manual installs or Laravel’s Artisan commands with custom scripts. For multisite, use `wp-cli` or plugins like WP REST API with Laravel’s HTTP client. This package is best for Composer-driven workflows.
- How do I handle WordPress plugins/themes in this setup?
- Plugins/themes should be installed via WordPress admin or WP-CLI *after* the core install. Avoid Composer for plugins to prevent version conflicts. Use Laravel’s filesystem to manage uploads (e.g., `storage/app/public/wordpress_uploads`).