skip to Main Content

I’ve installed the current version of directus on my VPS (Debian 10, PHP 7.3, Apache 2.4.38).

When running the browser-based install, an error appears in the /logs saying:

[2020-02-27 20:31:59] api[].ERROR: ParseError: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/clients/client0/web16/web/vendor/symfony/translation-contracts/TranslatorTrait.php:44

For me, it sounds like if it was a wrong PHP version, but PHP 7.3 is running.

I don’t know whether this is important, but after ignoring this, on the page where you enter the database connection parameter, the POST to /server/projects returns with Error 500 “Internal Server Error”.

I cannot find any log entry.

  • How can I find the reason for the 500?
  • Is it possible to configure the application without the browser-based installation?

Edit
Switched back from master to v8.5.5 and in this source code, there is a trans function:

/**
 * {@inheritdoc}
 */
public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string
{
    if (null === $id || '' === $id) {
        return '';
    }

    if (!isset($parameters['%count%']) || !is_numeric($parameters['%count%'])) {
        return strtr($id, $parameters);
    }

So there is indeed a type ?string.

My PHP version should be able to handle this, IMO. But before, I had Debian 9 with PHP 7.0 where I had the same problem and which was the reason to upgrade Debian from 9 to 10.

Is it possible that a compile-cache from Debian 9 is still present?

But I suppose this is not the main problem. My problem is that I receive an error 500 and besides the 500-log-entry in apache error.log, there is nothing I can see to diagnose this issue.

2

Answers


  1. A handy way to find syntax errors when error reporting and logs don’t yield anything is to try and run the script through command line using the lint flag, e.g.

    php -l path/to/file.php
    
    Login or Signup to reply.
  2. TranslatorTrait.php seems to be corrupted, because line #44 actually should be:

    public function trans($id, array $parameters = [], $domain = null, $locale = null)
    

    So obviously, there should be no unexpected ?. Try to refresh composer dependencies with:

    rm -rf vendor/*
    

    And then:

    composer clearcache && composer install
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search