Now including start.sh to start a php server using the router.php so no webserver is needed.
HUGE – Installation und Setup
Schnellstart
- Voraussetzungen prüfen (siehe unten)
- Abhängigkeiten installieren
- Datenbank anlegen
- Webserver auf
public/zeigen lassen - Starten und testen
Befehle (Beispiele):
# Composer installieren (macOS – über Homebrew)
brew install composer
# Abhängigkeiten holen (im Projektordner)
composer install
# Datenbank & Tabellen anlegen
mysql -u root -p < application/_installation/01-create-database.sql
mysql -u root -p < application/_installation/02-create-table-users.sql
mysql -u root -p < application/_installation/03-create-table-notes.sql
# Rechte für Avatare (je nach OS anpassen)
# Ubuntu/Debian:
sudo chown -R www-data:www-data public/avatars
sudo chmod -R 775 public/avatars
# macOS (Apache Standardnutzer _www):
sudo chown -R _www:_www public/avatars
sudo chmod -R 775 public/avatars
Voraussetzungen
- PHP >= 5.5 (laut composer.json)
- Composer
- Apache 2.4 mit
mod_rewrite - MySQL/MariaDB
- PHP-Erweiterungen: PDO + pdo_mysql, OpenSSL, mbstring
- Schreibrechte für
public/avatars/
Projekt beziehen
- Repository klonen oder entpacken
- In den Projektordner wechseln
Abhängigkeiten installieren (Composer)
- Im Projektordner ausführen:
composer install
Webserver konfigurieren (Apache)
- DocumentRoot auf
.../huge/publicsetzen AllowOverride Allaktivieren (damit.htaccessgreift)mod_rewriteaktivieren- Apache neu starten
Minimalbeispiel VirtualHost:
<VirtualHost *:80>
ServerName huge.local
DocumentRoot "/pfad/zu/huge/public"
<Directory "/pfad/zu/huge/public">
AllowOverride All
Require all granted
</Directory>
SetEnv APPLICATION_ENV development
ErrorLog "${APACHE_LOG_DIR}/huge_error.log"
CustomLog "${APACHE_LOG_DIR}/huge_access.log" combined
</VirtualHost>
Hinweis: .htaccess leitet auf public/index.php um.
Datenbank anlegen
- SQL-Skripte in dieser Reihenfolge ausführen (
application/_installation/):01-create-database.sql02-create-table-users.sql03-create-table-notes.sql
Beispiel in der Shell:
mysql -u root -p < application/_installation/01-create-database.sql
mysql -u root -p < application/_installation/02-create-table-users.sql
mysql -u root -p < application/_installation/03-create-table-notes.sql
Framework-Konfiguration (Entwicklung)
- Datei:
application/config/config.development.php - Wichtige Schlüssel:
- URL
URL(Basis-URL, endet mit/; auto-detect möglich)
- Pfade
PATH_CONTROLLER,PATH_VIEW(meist unverändert)
- Routing
DEFAULT_CONTROLLER,DEFAULT_ACTION
- Datenbank
DB_TYPE,DB_HOST,DB_PORT,DB_NAME,DB_USER,DB_PASS,DB_CHARSET
- Captcha
CAPTCHA_WIDTH,CAPTCHA_HEIGHT
- Cookies & Session
COOKIE_RUNTIME,COOKIE_PATH,COOKIE_DOMAIN,COOKIE_SECURE,COOKIE_HTTPSESSION_RUNTIME
- Avatare/Gravatar
USE_GRAVATAR,GRAVATAR_DEFAULT_IMAGESET,GRAVATAR_RATINGAVATAR_SIZE,AVATAR_JPEG_QUALITY,AVATAR_DEFAULT_IMAGE- Ordner
public/avatars/beschreibbar machen
- Sicherheit
ENCRYPTION_KEY,HMAC_SALT(für eigene Installation ändern)
- E-Mail
EMAIL_USED_MAILER,EMAIL_USE_SMTPEMAIL_SMTP_HOST,EMAIL_SMTP_AUTH,EMAIL_SMTP_USERNAME,EMAIL_SMTP_PASSWORD,EMAIL_SMTP_PORT,EMAIL_SMTP_ENCRYPTIONEMAIL_PASSWORD_RESET_*,EMAIL_VERIFICATION_*
- URL
Umgebungen (Environment)
- Klasse:
application/core/Environment.php - Ermittelt
APPLICATION_ENV(Fallback:development) - Weitere Datei möglich:
config.production.php - Apache-Variable setzen:
SetEnv APPLICATION_ENV production
Verzeichnisrechte
public/avatars/beschreibbar- Optional Logs/Uploads je nach Bedarf
Starten
- Browser:
http://<host>/ - Registrierung/Login testen
- Mailversand nur mit korrekt konfiguriertem SMTP
Tests ausführen
- PHPUnit unter
vendor/bin/phpunit - Konfiguration:
tests/phpunit.xml
vendor/bin/phpunit -c tests/phpunit.xml
Häufige Probleme
- 404 bei allen Routen
mod_rewriteaktivierenAllowOverride Allsetzen- DocumentRoot auf
public/
- Falsche Links/Assets
URLin der Config prüfen
- Datenbankfehler
DB_*-Werte und Rechte prüfen
- E-Mails kommen nicht an
EMAIL_USE_SMTP=trueund SMTP-Daten prüfen
- Avatare fehlen
- Schreibrechte für
public/avatars/
- Schreibrechte für
Option: Vagrant „One-Click-Installation“
- Ordner:
_one-click-installation/ - Voraussetzungen: Vagrant + VirtualBox
cd _one-click-installation
vagrant up
- Projekt über die VM nutzen (Host/Ports laut Vagrant-Ausgabe)
Struktur (Kurz)
public/(Webroot,.htaccess,index.php)application/controller/(Controller)application/model/(Modelle)application/view/(Views)application/config/(Konfiguration je Environment)application/_installation/(SQL-Skripte)vendor/(Composer-Abhängigkeiten)tests/(PHPUnit)
Description
Languages
PHP
98.2%
Shell
1.6%
Hack
0.2%