From 6ffe1bc48e39e0783fad1a50bf5ddaf831ead01f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Fri, 4 Oct 2024 10:59:37 +0200 Subject: [PATCH] [TASK] Update ddev installation instruction for TYPO3 >=12 (#451) ddev recieved support to regonize changed configuration file places and nameing for TYPO3 v12 and newer, using composer.json input ant the pasing the `Typo3Version` class version code to determine if a composer based TYPO3 v12 or higher is given. That works, however it may be necessary to restart ddev after installing our beloved CMS which can be achieved by executing ```terminal ddev restart ``` after the setup using cli commands. Without this, the `additional.php` may not be written by ddev when user tries to open the backend leading to errors realted to missing the correct `trustedHostsPattern` needed for `ddev`. In the past this worked without issues, because silent upgrade migration has been run even within the setup and installation process. Usually, for new installation that does not make sense and has been removed from TYPO3 for v13 and v14 with [1]. With TYPO3 v13.0 a major feature has been intruduced which allows to configure the backend url instead of having it fixed to `/typo3/`. That required bigger changes and combining frontend and backend entry points and changed to webserver configuration. For `Apache2` this has been added and is shipped with the TYPO3 version - NGNIX and other webserver needs adjustment. The default webserver for ddev is NGNIX and not apache2 and ddev seems not not have the required changes on board required to satisfy a TYPO3 v13 installation. That means that it is more than usefull to provide a little more in the commands which users can simply copy and paste and having a good kickstart experience than alternativly trying to explain on `get.typo3.org` how to change that template manually in ddev. This change adjusts the ddev based installation instruction for TYPO3 v12 and v13 to be usable and working. [1] https://review.typo3.org/c/Packages/TYPO3.CMS/+/81793 --- .../default/partials/version/download.html.twig | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/templates/default/partials/version/download.html.twig b/templates/default/partials/version/download.html.twig index b781ede3..6738029f 100644 --- a/templates/default/partials/version/download.html.twig +++ b/templates/default/partials/version/download.html.twig @@ -40,7 +40,7 @@

Before proceeding, make sure your DDEV installation is up to date.

In a new project folder using your favorite shell, run these lines:

-                                    ddev config --project-type=typo3 --docroot=public{{ php_version_option }}
+                                    ddev config --project-type=typo3 --docroot=public{{ php_version_option }} --webserver-type 'apache-fpm'
                                     ddev composer create --no-install "typo3/cms-base-distribution:^{{ package_version }}"
                                     ddev composer install
                                     {% if version == 12 %}
@@ -53,11 +53,12 @@
                                             ddev typo3 install:setup
                                         {% endif %}
                                     {% elseif version >= 12 %}
-                                        ddev typo3 setup
+                                        ddev typo3 setup --server-type=apache --driver=mysqli --host=db --port=3306 --dbname=db --username=db --password=db
+                                        ddev restart
                                     {% else %}
                                         ddev exec touch public/FIRST_INSTALL
                                     {% endif %}
-                                    ddev launch
+                                    ddev launch /typo3/
                                 

If you are experienced with Composer you can create your own composer.json and select the needed packages of TYPO3 via the Composer Helper. Instead of the ddev composer create command above, run the command created with the Composer Helper prepended with ddev. E.g.:

-                                    ddev config --project-type=typo3 --docroot=public{{ php_version_option }}
+                                    ddev config --project-type=typo3 --docroot=public{{ php_version_option }} --webserver-type 'apache-fpm'
                                     ddev composer require "typo3/cms-core:^{{ package_version }}" "typo3/minimal:^{{ package_version }}" ...
                                     {% if console %}
                                         {% if version == 10 %}
@@ -84,11 +85,12 @@
                                             ddev typo3 install:setup (if the TYPO3 Console is installed)
                                         {% endif %}
                                     {% elseif version >= 12 %}
-                                        ddev typo3 setup
+                                        ddev typo3 setup --server-type=apache --driver=mysqli --host=db --port=3306 --dbname=db --username=db --password=db
+                                        ddev restart
                                     {% else %}
                                         ddev exec touch public/FIRST_INSTALL
                                     {% endif %}
-                                    ddev launch
+                                    ddev launch /typo3/