# Troubleshooting Guide

## Internal Server Error (500)

### Common Causes

1. **.htaccess Issues**
   - PHP directives in .htaccess not allowed (CGI/FastCGI mode)
   - Syntax errors in .htaccess
   - **Solution**: Remove `php_value` directives from `.htaccess`

2. **PHP Configuration**
   - Missing PHP extensions
   - Incorrect PHP version
   - **Solution**: Check `php -v` and `php -m`

3. **Laravel Errors**
   - Missing environment variables
   - Database connection issues
   - **Solution**: Check `storage/logs/laravel.log`

### Quick Fixes

```bash
# Clear all caches
php artisan config:clear
php artisan cache:clear
php artisan route:clear
php artisan view:clear

# Check for errors
Get-Content storage\logs\laravel.log -Tail 50

# Verify routes
php artisan route:list
```

## Upload Limits Error

See `docs/UPLOAD_LIMITS_FIX.md` for detailed instructions.

**Quick Fix:**
1. Edit `C:\wamp64\bin\php\php8.2.26\php.ini`
2. Set `upload_max_filesize = 10M` and `post_max_size = 12M`
3. Restart WAMP

## Admin Login Issues

See `docs/ADMIN_LOGIN_GUIDE.md` for detailed instructions.

**Quick Check:**
```bash
php artisan admin:check-access
```

## Database Connection Issues

```bash
# Test connection
php artisan tinker
DB::connection()->getPdo();

# Check migrations
php artisan migrate:status
```

## Permission Issues

```bash
# Fix storage permissions (Linux/Mac)
chmod -R 775 storage bootstrap/cache

# Clear permission cache
php artisan permission:cache-reset
```

