# cPanel Requirements for Laravel 12 Deployment

## PHP Version Requirements

### Minimum Required: PHP 8.2 or higher
- Laravel 12 requires PHP 8.2+
- Recommended: PHP 8.3 (latest stable)

## Required PHP Extensions

### Core Laravel Requirements
- **BCMath** - Arbitrary precision mathematics
- **Ctype** - Character type checking
- **Fileinfo** - File information
- **JSON** - JSON parsing
- **Mbstring** - Multibyte string
- **OpenSSL** - OpenSSL library
- **PDO** - PHP Data Objects
- **Tokenizer** - Tokenizer
- **XML** - XML parsing

### Package-Specific Requirements
- **GD** or **Imagick** - Image processing (for PDF generation)
- **Zip** - ZIP archive support
- **Curl** - HTTP client
- **Intl** - Internationalization

### Database Extensions
- **PDO_MySQL** - MySQL database driver

### Optional but Recommended
- **Redis** - Caching (if using Redis)
- **Memcached** - Caching (if using Memcached)

## cPanel Configuration Checklist

### 1. PHP Version
- [ ] Set PHP version to 8.2 or higher in cPanel "Select PHP Version"
- [ ] Verify PHP version via `php -v` in SSH

### 2. PHP Extensions
- [ ] Enable all required extensions in cPanel PHP Selector
- [ ] Verify extensions via `php -m` in SSH

### 3. Database
- [ ] MySQL/MariaDB database created
- [ ] Database user with proper permissions
- [ ] Database credentials ready for .env file

### 4. File Permissions
- [ ] Storage directory: 755 or 775
- [ ] Bootstrap/cache directory: 755 or 775
- [ ] All other directories: 755
- [ ] All files: 644

### 5. Apache Configuration
- [ ] mod_rewrite enabled
- [ ] AllowOverride All in .htaccess
- [ ] FollowSymLinks enabled

## Commands to Run on cPanel Server

### Check PHP Version
```bash
php -v
```

### Check PHP Extensions
```bash
php -m | grep -E "bcmath|ctype|fileinfo|json|mbstring|openssl|pdo|tokenizer|xml|gd|zip|curl|intl"
```

### Check MySQL Extension
```bash
php -m | grep pdo_mysql
```

## Common cPanel Issues and Solutions

### Issue: PHP Version Too Old
**Solution**: Upgrade PHP version in cPanel PHP Selector to 8.2+

### Issue: Missing Extensions
**Solution**: Enable required extensions in cPanel PHP Selector

### Issue: File Permission Errors
**Solution**: Run permission commands (see deployment guide)

### Issue: Storage Link Not Working
**Solution**: Run `php artisan storage:link` via SSH

### Issue: JasperReports Not Available
**Solution**: Install JasperStarter or use alternative PDF generation method
