When trying to install Filament on Ubuntu using composer require filament/filament
, you encounter two critical errors:
- Missing PHP intl extension (
ext-intl
not enabled in CLI). - PHP version conflict (Filament v3.3.x requires PHP 8.1+ but your CLI uses PHP 8.3, while your web server may use a different version).
Step-by-Step Solution:
1. Install the PHP intl Extension
The intl
extension is required by Filament but missing in your CLI environment.
sudo apt update
sudo apt install php8.2-intl # Use PHP 8.2 (widely supported)
2. Switch Default PHP Version for CLI
Ensure CLI and web server use compatible PHP versions (e.g., PHP 8.2):
sudo update-alternatives --config php
- Select
php8.2
from the list (enter its selection number). - Verify with:
php -v
3. Enable the intl Extension
Check if intl
is enabled:
php -m | grep intl # Should output "intl"
If missing, manually enable it:
sudo phpenmod intl # For PHP 8.2
sudo systemctl restart apache2 # Or nginx/php-fpm
4. Reinstall Filament
Retry the installation:
composer require filament/filament
⚠️ Critical Note: Avoid –ignore-platform-req Shortcut
While Composer suggests using --ignore-platform-req=ext-intl
to bypass the error:
# NOT RECOMMENDED FOR PRODUCTION
composer require filament/filament --ignore-platform-req=ext-intl
Why this is dangerous:
- Hidden Runtime Errors: Filament requires
intl
for core functionality (date/number formatting, translations). - Environment Inconsistency: Your local environment won’t match production, causing “works on my machine” failures.
- Security Risks: Missing extensions may bypass security validations.
- Upgrade Traps: Future updates may fail catastrophically when dependency checks pass but actual requirements aren’t met.
Acceptable use cases:
- Temporary testing during development (immediately fix afterward)
- CI/CD pipelines where extensions are managed separately
- When you’ll manually verify all intl-dependent functionality
Why the Full Solution Works:
- Consistent Environment
Syncs CLI (Composer) and web server PHP versions (8.2 recommended for stability). - Proper Dependency Handling
Installs required system-level extensions instead of masking missing components. - Future-Proofing
Prevents runtime errors in Filament’s admin panel, forms, and table components that rely onintl
.
Troubleshooting Tips:
- PHP Version Check:
# CLI version:
php -v
# Web server version (create info.php):
<?php phpinfo();
- Extension Verification:
# Check loaded extensions:
php -r "print_r(get_loaded_extensions());"
- Fallback for PHP 8.3:
If you must use PHP 8.3:
sudo apt install php8.3-intl # If available in your repo
sudo update-alternatives --set php /usr/bin/php8.3
- Verify PHP.ini:
Check/etc/php/8.2/cli/php.ini
forextension=intl
(should be uncommented).
Always resolve platform requirements instead of ignoring them – your production environment will thank you! 🚀
Read More
تابع Concat اکسل | جمع کردن کلمات و رشته ها در اکسل
توابع توکار VBA | لیست کامل توابع داخلی در ویژوال بیسیک
عملگرهای VBA | انجام عملیات روی داده ها و ایجاد عبارت ها
دستور پرینت در اکسل با استفاده از VBA
مرجع VBA | فهرست دستورات و مفاهیم زبان برنامه نویسی ویژوال بیسیک