I installed Drupal8 for the first time to try things out. I used nginx and mySQL on FreeBSD with php-fpm for fastcgi. I have the nginx root set to /usr/local/www/drupal8 cause that's where the install.php file is. If I put a HTML file in there, I can view it with localhost/index.html. If I write a little info.php file, it runs and shows the expected phpinfo() data but if I try to do localhost/install.php, the address bar changes to localhost/core/install.php and nginx returns a 502 Bad Gateway and the nginx error log shows this:

Call to undefined function Doctrine\Common\Annotations\token_get_all() in /usr/local/www/drupal8/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php on line 56" while reading response header from upstream, client:, server: localhost, request: "GET /core/install.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "localhost"

I see this error in a few Google searches but the solutions are related to special programs or programmer errors. I followed directions on setting up php.ini and copied settings.php. I don't know what to do or where to look to fix this.

  • 1
    You've somehow ended up with a version of PHP built without tokenizer support (which Drupal requires). Drupal can't help you to fix that, you'll need to recompile PHP
    – Clive
    May 30, 2017 at 11:57
  • @Clive PHP 5.6.30
    – Rob
    May 30, 2017 at 11:59
  • I updated the comment
    – Clive
    May 30, 2017 at 11:59

1 Answer 1


I installed Drupal8 from FreeBSD ports. I don't normally use PHP for anything so PHP version 5.6.30 is what is on my computer so either that is what Drupal used or that's what the port installed. I don't know why PHP7 was not installed instead.

In FreeBSD, the tokenizer extension is not automatically installed so I added php56-tokenizer and now Drupal8 works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.