admin
ADMIN
++
Puan
1
Çözümler
0
XenForo
config.php dosyası, XenForo’nun çekirdek yapılandırma dosyasıdır.
Veritabanı, debug, cache, güvenlik ve performans ayarları buradan yapılır.
Dosya yolu:
Kod:
/src/config.php
1) Veritabanı Bağlantı Ayarları (ZORUNLU)
Kod:
$config['db']['host'] = 'localhost';
$config['db']['port'] = 3306;
$config['db']['username'] = 'db_kullanici';
$config['db']['password'] = 'db_sifre';
$config['db']['dbname'] = 'db_adi';
2) Geliştirici Modu (Debug)
Kod:
$config['debug'] = true;
$config['development']['enabled'] = true;
$config['disableTemplateCache'] = true;
Ne işe yarar?
- Template değişiklikleri anında görünür
- Hata mesajları detaylı çıkar
- Addon geliştirme kolaylaşır
3) Site URL Tanımı (Önerilir)
Kod:
$config['fullUnicode'] = true;
$config['cookie']['path'] = '/';
$config['cookie']['domain'] = '';
Unicode açık olursa:
- Emoji
- Türkçe karakter
- UTF-8 içerikler sorunsuz çalışır
4) Cache / Performans (Redis – Memcached)
Redis Kullanımı
Kod:
$config['cache']['enabled'] = true;
$config['cache']['handler'] = 'Redis';
$config['cache']['config'] = [
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0
];
Memcached Kullanımı
Kod:
$config['cache']['enabled'] = true;
$config['cache']['handler'] = 'Memcached';
$config['cache']['config'] = [
'host' => '127.0.0.1',
'port' => 11211
];
5) Log & Hata Kayıtları
Kod:
$config['log']['enabled'] = true;
$config['log']['level'] = 'debug';
Hata takibi yaparken hayat kurtarır.
6) Güvenlik Ayarları
Kod:
$config['enableListeners'] = true;
$config['enableMailQueue'] = true;
İstersen admin IP kısıtlaması da yapılabilir (ileri seviye).
7) E-posta (SMTP) Ayarı (Opsiyonel)
Kod:
$config['emailTransport'] = [
'transport' => 'smtp',
'host' => 'smtp.domain.com',
'port' => 587,
'username' => 'mail@domain.com',
'password' => 'mail_sifre',
'encryption' => 'tls'
];
8) CDN / Proxy (Cloudflare vb.)
Kod:
$config['enableReverseProxy'] = true;
$config['trustedProxies'] = ['0.0.0.0/0'];
Cloudflare kullanıyorsan IP sorunu çözülür.
9) Addon & Event Kontrolleri
Kod:
$config['enableListeners'] = true;
$config['enableMailQueue'] = true;
Addon’lar düzgün çalışsın diye açık olmalı.
10) Örnek Tam
Kod:
<?php
$config['db']['host'] = 'localhost';
$config['db']['port'] = 3306;
$config['db']['username'] = 'db_user';
$config['db']['password'] = 'db_pass';
$config['db']['dbname'] = 'db_name';
$config['debug'] = false;
$config['disableTemplateCache'] = false;
$config['fullUnicode'] = true;
$config['cache']['enabled'] = false;
Kritik Uyarılar
- config.php herkese açık olmamalı
- Canlı sitede debug = true bırakma
- Değişiklikten önce yedek al
- Hosting izinleri: 644 veya 640
Net Özet
- config.php = XenForo’nun beyni
- Debug → geliştirme için
- Cache → performans için
- SMTP → mail için
- Redis → trafik varsa şart