Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tobenschmidt/1c4bbcfe6d5f9ff795f1234d5e2ec5fd to your computer and use it in GitHub Desktop.
Save tobenschmidt/1c4bbcfe6d5f9ff795f1234d5e2ec5fd to your computer and use it in GitHub Desktop.
Introduction Package based TYPO3 v7 installation with Composer, Docker and DDEV

Introduction Package based TYPO3 v7 installation with Composer, Docker and DDEV

A few hints about setting up an Introduction Package based TYPO3 v7 installation with Composer, Docker CE including Docker Compose and DDEV. I guess this could be helpful for those who still have to do bugfixing and development with the more or less outdated TYPO3 v7. My operating system is Linux Mint 19.1 Tessa MATE (64-bit). Things might vary on other systems.

Composer

Packagist provides the Introduction Package only in version 3 or higher. TYPO3 v7 though requires version 2 which is available only via TYPO3 Extension Repository. To use version 2 add https://composer.typo3.org/ to the repositories section of your composer.json file, require typo3-ter/introduction instead of typo3/cms-introduction and set ^2 as version constraint.

DDEV

Starting with version 1.3.0 DDEV includes MariaDB 10.2 which is incompatible with TYPO3 v7 because some field names in TYPO3 database tables use reserved database keywords. Install version 1.2.0 which includes MariaDB 10.1. Since version 1.5.0 one can configure a DDEV project to use MariaDB 10.1 so there is no need to stick to an outdated version of DDEV.

During configuration DDEV creates an AdditionalConfiguration.php file for TYPO3 v8. Change the database section of this file to TYPO3 v7 format. To prevent the creation of this file at all you could choose the project type php instead of typo3 and manually add the file later.

To get around the database error Index column size too large. The maximum column size is 767 bytes. during installation of TYPO3 v7 add some custom database configuration to .ddev/mysql/my.cnf in your project directory to adjust collation and character set settings.

The Application Context of TYPO3 v7 can be set via YAML configuration.

Docker

During the trial and error process of setting up the TYPO3 v7 installation at some point the strange Docker related database error Failed to start xyz: db service health check timed out occured. I tried to reconfigure DDEV and deleted all Docker container and images but I didn't manage to fix this. Only creating a new DDEV project with a different name "fixed" this. This happened only once and as I am not yet familiar with all this stuff I probably missed something simple and obvious.

How to set up

  1. Install Composer, Docker CE, Docker Compose and DDEV
  2. Create a project directory
  3. Create composer.json file inside this directory
  4. Run composer install
  5. Run ddev config --mariadb-version=10.1 and answer the questions
  6. Adjust AdditionalConfiguration.php file
  7. Add custom database configuration
  8. Add Application Context configuration
  9. Run ddev start
  10. Open local project URL in browser
  11. Install TYPO3 v7
{
"repositories": [
{
"type": "composer",
"url": "https://composer.typo3.org/"
}
],
"name": "MYVENDORPREFIX/MYPROJECTNAME",
"description": "Introduction Package based TYPO3 v7",
"type": "project",
"require": {
"typo3/cms": "^7",
"typo3-ter/introduction": "^2",
"helhum/typo3-console": "^4.9.6"
},
"license": "GPL",
"authors": [
{
"name": "Author Name",
"email": "author.name@example.org"
}
],
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": "web"
}
}
}
<?php
// Database configuration for TYPO3 v7
$GLOBALS['TYPO3_CONF_VARS']['DB'] = array_merge($GLOBALS['TYPO3_CONF_VARS']['DB'], [
'database' => 'db',
'host' => 'db',
'password' => 'db',
'port' => '3306',
'username' => 'db',
]);
[mysqld]
collation-server = utf8_general_ci
character-set-server = utf8
innodb_large_prefix=false
version: '3.6'
services:
web:
environment:
- TYPO3_CONTEXT=Development
@KaffDaddy
Copy link

Because of your problems with deleting the database: in the folder ~/.ddev you will find all database you can manually delete if you want.

@tobenschmidt
Copy link
Author

Oops, I missed your message. I cannot remember all the things I tried to fix this error. I thought I deleted this folder and started from scratch with DDEV. Still it didn't work.

Where do I find the databases in my home directories .ddev folder? There's a router-compose.yaml file, an .update file and folders for every project with import-db subfolders. As I started with fresh and empty databases the are no files in the import-db folders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment