0

The TYPO3 installation fails at the last step. The error message in the log says: PHP Fatal error: Class 'Doctrine\Common\Lexer' not found

Here is the code (in fact all the code that is present in this project):

.ddev/config.yaml

APIVersion: v0.20.0
name: v9
type: typo3
docroot: public
php_version: "7.2"
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
provider: default

composer.json

{
  "name": "vendor/v9",
  "require": {
    "typo3/minimal": "~9.3"
  }
}

public/typo3conf/AdditionalConfiguration.php

<?php
/** #ddev-generated: Automatically generated TYPO3 AdditionalConfiguration.php file.
 ddev manages this file and may delete or overwrite the file unless this comment is removed.
 */

$GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = '.*';

$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default'] = array_merge($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default'], [
                'dbname' => 'db',
                'host' => 'db',
                'password' => 'db',
                'port' => '3306',
                'user' => 'db',
]);

ddev start && ddev ssh then composer install and confirm with Y when ready I open http://v9.ddev.local/ and get redirected to http://v9.ddev.local/typo3/install.php

Now i have to create FIRST_INSTALL. Done. "No problems detected, continue with installation". Step 2 and 3 get skipped because database connection is already known by AdditionalConfiguration.php (generated by ddev). Set up a username and password and the Sitename. "Continue"

Now i get a blue progress bar and nothing happens. Entering ddev logs shows this error:

==> /var/log/nginx/error.log <==
2018/07/19 11:45:22 [error] 223#223: *440 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Class 'Doctrine\Common\Lexer' not found in /var/www/html/public/typo3/sysext/core/Classes/Database/Schema/Parser/Lexer.php on line 22" while reading response header from upstream, client: REMOVED_IP_ADDRESS, server: _, request: "POST /typo3/install.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm.sock:", host: "v9.ddev.local", referrer: "http://v9.ddev.local/typo3/install.php"

==> /var/log/php-fpm.log <==
[19-Jul-2018 11:45:22] WARNING: [pool www] child 232 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Class 'Doctrine\Common\Lexer' not found in /var/www/html/public/typo3/sysext/core/Classes/Database/Schema/Parser/Lexer.php on line 22"
Kevin Appelt
  • 802
  • 7
  • 14
  • Could you please improve the title to give a hint of the problem? At least add "fails" to the title, or maybe "Fails due to lexer missing" or something. Please improve the first paragraph to explain the actual problem before you launch into code. – rfay Jul 19 '18 at 12:13
  • @rfay I have done some improvements and hope they are satisfactory to you. – Kevin Appelt Jul 19 '18 at 12:37
  • Thanks, way better, much appreciated. – rfay Jul 20 '18 at 00:58

3 Answers3

3

This is a known bug in the new 9 version: https://forge.typo3.org/issues/85552

As mentioned in the issue, you should be able to fix it if you include lexer in your own composer.json: composer require doctrine/lexer:^1.0

RinyVT
  • 315
  • 1
  • 4
0

Sounds like autoload problem. Did you try ddev exec composer dump -d /var/www/html?

Thomas Löffler
  • 5,922
  • 1
  • 14
  • 29
0

The 'lexer class not found' issue has been fixed in latest master already, but I'm not fully sure out of the box on how you can tell ddev to use that instead, or how you could apply the patch manually. alternatively you could probably go with an older doctrine version (the one that is in core master composer.lock should do).

Christian Kuhn
  • 928
  • 5
  • 6
  • I just added "minimum-stability": "dev" to composer.json and switched to "typo3/minimal": "dev-master" which uses the current typo3 master. The error message is gone, but the installation still can't complete. – Kevin Appelt Jul 19 '18 at 12:12