Schritt für Schritt: Installation 4.5 mit Windows7 u. Xampp 7.2.1
Update 2021:
Mittlerweile existiert eine XAMPP Anleitung in der Contao Dokumentation.
Hallo,
hier wurde bereits mehrfach auf die Contao Installation über Windows/Xampp eingegangen. Ich habe die verschiedenen Beiträge (Beispiel) gelesen und wollte nochmals über eine frische Installation alle Schritte nachvollziehen. Daher dieser Beitrag.
Update: Contao-Manager 1.0.0
Der CM 1.0.0 läuft jetzt auch unter Windows/Xampp. Einfach die aktuelle "contao-manager.phar.php" in das Web Verzeichnis kopieren und aufrufen. In der "Serverkonfiguration" existiert jetzt die auch die Voreinstellung "Xampp (Windows)"
Hinweis:
Eine rudimentäre Alternative für Contao 4.4.x ohne eigene vhost Einträge im Xampp Standard Verzeichnis "/xampp/htdocs/" finden Sie hier ...
Meine Voraussetzungen sind Windows7 mit der aktuellen Xampp Version (7.2.1).
Da ich mehrere Xampp Versionen parallel laufen habe (s. hier) habe ich mir die aktuelle portable Version gezogen (xampp-portable-win32-7.2.1-0-VC15.zip).
Update:
Eine Windows Xampp Installation mit mehreren PHP Versionen nutzen
Weiterhin bin ich unter Windows7 mit Administrator Rechten unterwegs - es wurde hier mehrfach darauf hingewiesen, das dies wichtig ist. Sind Sie als normaler Windows User angemeldet, sollten Sie darauf achten das Sie z.B. jeweils die Xampp Installation, das Xampp Control Panel o. die Xampp Shell als Administrator ausführen!
Update:
Alternativ kann man als normaler Windows User so vorgehen wie xchs und Spooky es hier weiter unten beschreiben.
Darüberhinaus habe ich die originale Xampp/Apache Einstellungen nicht verändert - PHP läuft also weiterhin als Modul (Apache 2.0 Handler).
Update:
Vorgehensweise zur FastCGI Umsetzung mit dieser Xampp Version finden Sie hier.
Update:
Vorgehensweise zur SSL Nutzung / Xampp CertificateFile von Andreas - siehe:
https://community.contao.org/de/show...l=1#post486836
Xampp Installation:
Ich habe das .zip nach "C:/xampp721" entpackt und im Anschluß die "setup_xampp.bat" aufgerufen.
PHP Einstellungen:
In der /php/php.ini habe ich die Extensions
Code:
extension=intl
extension=soap
aktiviert und überprüft ob der folgende Eintrag korrekt ist:
allow_url_fopen = On
Datenbank mysql bzw. MariaDB:
In der "\phpMyAdmin\config.inc.php" habe ich folgendes geändert:
Code:
$cfg['Servers'][$i]['auth_type'] = 'config';
nach
$cfg['Servers'][$i]['auth_type'] = 'cookie';
Für mysql habe ich in der "mysql/bin/my.ini " folgende Einträge (unterhalb der bestehenden innodb settings) ergänzt:
Code:
innodb_large_prefix = 1
innodb_file_format = Barracuda
innodb_file_format_max = Barracuda
innodb_file_per_table = 1
Virtuelle Hosts:
HINWEIS:
Dieser Abschnitt wird nicht unbedingt benötigt. Wer einfach mit einer "normalen" Xampp Konfiguration - ohne vhosts - arbeiten möchte - also eine Contao Installation z.B. in das Verzeichnis "c:\xampp\htdocs" e.g. "c:\xampp\htdocs\contao4" installiert kann im Anschluß das Contao Installtool einfach über "http://localhost/contao4/web/contao/install" aufrufen ...
Da ich in der "httpd-vhosts.conf" mit der Direktive "VirtualDocumentRoot" arbeite habe ich in der "\apache\conf\extra\httpd-xampp.conf" das in dieser Xampp Version standardmäßige NICHT aktivierte Modul "vhost_alias_module" explizit geladen (einfach irgendwo einsetzen):
Code:
# for vhost settings with: VirtualDocumentRoot
# see https://httpd.apache.org/docs/2.4/mod/mod_vhost_alias.html
LoadModule vhost_alias_module modules/mod_vhost_alias.so
Ich halte meine Websites außerhalb des Xampp Verzeichnisses im Verzeichnis "C:/__SITES__". Daher folgende Einträge in "\apache\conf\extra\httpd-vhosts.conf":
Code:
<Directory "C:/__SITES__">
Options Indexes FollowSymLinks Includes ExecCGI
Order deny,allow
Allow from 127.0.0.1
AllowOverride All
Require all granted
Allow from all
</Directory>
NameVirtualHost *:80
UseCanonicalName Off
<VirtualHost *:80>
DocumentRoot "C:/xampp721/htdocs/"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
ServerAlias *.local
VirtualDocumentRoot "C:/__SITES__/%1/htdocs/web"
</VirtualHost>
Im folgenden Beispiel möchte ich die Contao Daten in das Verzeichnis "C:/__SITES__/contao45" legen und habe entsprechend der obigen "VirtualDocumentRoot" Direktive in der Windows hosts Datei (\Windows\System32\drivers\etc\hosts) folgenden Eintrag hinterlegt:
Code:
127.0.0.1 contao45.dev4
127.0.0.1 contao45.local
Update:
Normalerweise muß man in der Windows hosts jeden Eintrag manuell setzen (Wildcards sind nicht möglich). Spooky hat hier auf eine Alternative via "Acrylic DNS Proxy" aufmerksam gemacht.
Update 2:
Chrome und Firefox unterstützen die geliebte .dev nicht mehr. Ich nutze daher jetzt .local (Hab ich in den Angaben geändert.)
Xampp starten:
Wenn alles korrekt ist sollte man über das "Xampp Control Panel" nun Apache und MySQL starten können. Im "Xampp Control Panel" einmalig auf den "Shell" Button klicken - Es wird eine "xampp_shell.bat" im aktuellen Xampp Verzeichnis (hier: C:\xampp721 ) erstellt. Wenn man diese aufruft (als Administrator - nicht vergessen) sollte man bei Eingabe von "php -v" die PHP Version "PHP 7.2.1 (cli)" erhalten.
Weitere Vorbereitungen:
Um für den mysql root user ein Passwort zu setzen starten wir die Xampp Shell mit der Eingabe:
Code:
mysqladmin --user=root password "newpassword"
(Danach sollte bei Aufruf von phpmyadmin zukünftig die Abfrage auf Benutzername ("root") und Passwort erfolgen.)
Weiterhin löschen wir den anonymen User - siehe Beitrag
Code:
mysql -u root -p
DROP USER ''@'localhost';
Für Contao 4.5 steht in den Contao News:
"Wir nutzen zukünftig utf8mb4 als Datenbank-Zeichensatz und utf8mb4_unicode_ci als Datenbank-Kollation, damit sämtliche Unicode-Zeichen gespeichert werden können."
Wir erstellen uns entsprechend eine neue Datenbank auf der shell (alternativ über phpmyadmin):
Code:
mysql -u root -p
CREATE DATABASE db_contao45 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Wir sollten also eine neue, leere Datenbank "db_contao45" vorliegen haben - Check with phpmyadmin.
Verzeichnisstruktur:
Wir erstellen uns ein Verzeichnis "C:\__SITES__" mit dem Unterverzeichnis "contao45".
Dies bewirkt das bei Aufruf von "http://contao45.local" - entsprechend der Direktive "VirtualDocumentRoot "C:/__SITES__/%1/htdocs/web" -
die Inhalte aus "C:\__SITES__\contao45\htdocs\web" herangezogen werden.
Die finale Verzeichnisstruktur sähe also so aus:
Code:
+xampp721
+__SITES__
+contao45
+htdocs
web
Da das Unterverzeichnis "htdocs" noch nicht existiert kommt nun der PHP Composer ins Spiel. Unter Windows exisitiert kein "wget".
Ich habe mir daher die "composer.phar" einfach in das Verzeichnis "C:\__SITES__\contao45" kopiert.
(Manueller Download der "composer.phar" über https://getcomposer.org/download/ - im unteren Abschnitt hinter:
If you prefer to download the phar manually, here are the available versions ...)
Man könnte den Composer auch global installieren:
http://www.codecheese.com/2015/02/in...xampp-windows/
http://www.wdb24.com/how-to-install-...ws-with-xampp/
Update:
Oder das hier probieren ...
Sorry - Am besten den "Composer Installer" und dann die Xampp-Shell nutzen: siehe Beitrag. Ich habe die Beschreibung an den Stellen entsprechend angepaßt
Wir wechseln in der Xampp shell in das Verzeichnis "C:\__SITES__\contao45" und starten die Installation über
Code:
php composer.phar create-project contao/managed-edition htdocs 4.5.x
composer create-project contao/managed-edition htdocs 4.5.x
Im Verzeichnis "C:\__SITES__\contao45" sollte nun also ein Unterverzeichnis "htdocs" mit den entsprechenden Contao Verzeichnissen (u.a. "web") vorhanden sein.
Im Anschluß rufen wir das Contao Installtool über den Browser auf:
http://contao45.local/contao/install
und geben hierbei unsere zuvor erstellte Datenbank "db_contao45" an ...
Liste der Anhänge anzeigen (Anzahl: 1)
Contao Manager hängt
Hi,
danke für die tolle Zusammenfassung!
bei mir hängt der Contao Manager noch, nachdem ich dort die 4.5 oder die LTS ausgewählt habe.
Neuestes XAmpp auf Windows 7, per Composer konnte ich eine Contaoversion installieren, dort funktioniert auch der Manager etwas besser (ich sehe die installierten Pakete und könnte updaten)
irgendwelche Ideen?
Ciao
Reiner
Contao-Manager 1.0.4 Contao 4.4
An der Stelle wo du den Composer bemühst habe ich dann die contao-manager.phar.php eingesetzt. Dies hatte funktioniert, auch wenn ich zwischendurch diverse Fehlermeldungen bekomme. Seltsamerweise funktionierte es dann meistens beim 2. Versuch.
Einmal hatte ich glaube ich, aus welchem Grund auch immer plötzlich eine .htaccess über /web/ liegen.
Ein anderes mal diese Fehlermeldungen (sorry keine Logdateien vorhanden):
Jetzt hab ich die Fehlermeldung wieder (Pakete aktualisieren):
Code:
$ C:^\XAMPP^\php^\php.exe "-q" "C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php" "composer" "update" "contao/manager-bundle" "contao/calendar-bundle" "contao/comments-bundle" "contao/faq-bundle" "contao/listing-bundle" "contao/news-bundle" "contao/newsletter-bundle" "terminal42/contao-easy_themes" "--with-dependencies" "--prefer-dist" "--no-dev" "--no-progress" "--no-suggest" "--no-ansi" "--no-interaction" "--optimize-autoloader" 2>&1
Loading composer repositories with package information
Updating dependencies
Package operations: 0 installs, 1 update, 0 removals
- Updating doctrine/doctrine-cache-bundle (1.3.3 => 1.3.4): Downloading (100%)
Writing lock file
Generating optimized autoload files
RuntimeException: Unable to write config file to C:\__SITES__\contao44\htdocs\contao-manager/composer-update.get.json in phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/terminal42/background-process/src/AbstractProcess.php:76
Stack trace:
#0 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/terminal42/background-process/src/ProcessRunner.php(215): Terminal42\BackgroundProcess\AbstractProcess::writeConfig('C:\\__SITES__\\co...', Array)
#1 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/terminal42/background-process/src/ProcessRunner.php(112): Terminal42\BackgroundProcess\ProcessRunner->saveConfig()
#2 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/terminal42/background-process/src/ProcessRunner.php(53): Terminal42\BackgroundProcess\ProcessRunner->wait(1)
#3 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/terminal42/background-process/src/Command/ProcessRunnerCommand.php(36): Terminal42\BackgroundProcess\ProcessRunner->run()
#4 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/symfony/console/Command/Command.php(251): Terminal42\BackgroundProcess\Command\ProcessRunnerCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/symfony/console/Application.php(964): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Terminal42\BackgroundProcess\Command\ProcessRunnerCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/api/ApiApplication.php(70): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/symfony/console/Application.php(148): Contao\ManagerApi\ApiApplication->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/api/console(83): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 C:\__SITES__\contao44\htdocs\web\contao-manager.phar.php(55): require('phar://C:/__SIT...')
#11 {main}
# Process terminated with exit code -1
# Result: Unknown error
Beim 2. Versuch kommt da auch diese Fehlermeldung, er läuft dann aber erfolgreich durch und das hier ist die Ausgabe:
Code:
Console task complete!
The background task was completed successfully. Check the console protocol for the details.
Datenbank aktualisieren
$ C:^\XAMPP^\php^\php.exe "-q" "C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php" "composer" "update" "contao/manager-bundle" "contao/calendar-bundle" "contao/comments-bundle" "contao/faq-bundle" "contao/listing-bundle" "contao/news-bundle" "contao/newsletter-bundle" "terminal42/contao-easy_themes" "--with-dependencies" "--prefer-dist" "--no-dev" "--no-progress" "--no-suggest" "--no-ansi" "--no-interaction" "--optimize-autoloader" 2>&1
Loading composer repositories with package information
Updating dependencies
Nothing to install or update
Writing lock file
Generating optimized autoload files
contao/manager-plugin: Generating plugin class...
contao/manager-plugin: ...done generating plugin class
> Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication
Added/updated the web/app.php file.
Added/updated the web/app_dev.php file.
// Clearing the cache for the prod environment with debug
// false
[OK] Cache for the "prod" environment (debug=false) was successfully cleared.
// Warming up the cache for the prod environment with debug
// false
[OK] Cache for the "prod" environment (debug=false) was successfully warmed.
Trying to install assets as relative symbolic links.
--------- ------------------------ ------------------
Bundle Method / Error
--------- ------------------------ ------------------
WARNING ContaoCoreBundle absolute symlink
WARNING ContaoFaqBundle absolute symlink
WARNING ContaoNewsBundle absolute symlink
WARNING ContaoNewsletterBundle absolute symlink
WARNING ContaoCalendarBundle absolute symlink
WARNING ContaoCommentsBundle absolute symlink
--------- ------------------------ ------------------
[OK] All assets were successfully installed.
Added/updated the system/initialize.php file.
Symlinked the system/config/tcpdf.php file.
---- ------------------------------------- ----------------------------------------------------------------
Symlink Target / Error
---- ------------------------------------- ----------------------------------------------------------------
OK web/system/modules/easy_themes/html system/modules/easy_themes/html
OK system/themes/flexible vendor/contao/core-bundle/src/Resources/contao/themes/flexible
OK web/assets assets
OK web/system/themes system/themes
OK system/logs var/logs
---- ------------------------------------- ----------------------------------------------------------------
RuntimeException: Unable to write config file to C:\__SITES__\contao44\htdocs\contao-manager/composer-update.get.json in phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/terminal42/background-process/src/AbstractProcess.php:76
Stack trace:
#0 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/terminal42/background-process/src/ProcessRunner.php(215): Terminal42\BackgroundProcess\AbstractProcess::writeConfig('C:\\__SITES__\\co...', Array)
#1 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/terminal42/background-process/src/ProcessRunner.php(112): Terminal42\BackgroundProcess\ProcessRunner->saveConfig()
#2 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/terminal42/background-process/src/ProcessRunner.php(53): Terminal42\BackgroundProcess\ProcessRunner->wait(1)
#3 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/terminal42/background-process/src/Command/ProcessRunnerCommand.php(36): Terminal42\BackgroundProcess\ProcessRunner->run()
#4 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/symfony/console/Command/Command.php(251): Terminal42\BackgroundProcess\Command\ProcessRunnerCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/symfony/console/Application.php(964): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Terminal42\BackgroundProcess\Command\ProcessRunnerCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/api/ApiApplication.php(70): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/vendor/symfony/console/Application.php(148): Contao\ManagerApi\ApiApplication->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 phar://C:/__SITES__/contao44/htdocs/web/contao-manager.phar.php/api/console(83): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 C:\__SITES__\contao44\htdocs\web\contao-manager.phar.php(55): require('phar://C:/__SIT...')
#11 {main}
# Process terminated with exit code 0
# Result: OK
Vielleicht kannst du im ersten Thread an der Stelle wo du mit der Konsole arbeitest nochmal auf den Manager hinweisen (auch wenn das momentan noch so fehlerhaft ist).