Fatal error: Call to undefined function token_get_all() - drupal 8


#1

Hi. I’m attempting to install drupal8 on FreeBSD 10.2 but when I try to load
the front page in the browser, I get an empty page with just the error,

Fatal error: Call to undefined function Doctrine\Common\Annotations\token_get_all() in /data/htdocs/test1/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php on line 56
All the other extensions listed in extensions.ini seem to load and Drupal7 is working fine.

The tokenizer extension is installed but phpinfo() does not show it enabled
under the Configuration section. Although it does mention it in the PHP credits
section.

Here is the contents of /usr/local/etc/php/extensions.ini

extension=dom.so
extension=filter.so
extension=ftp.so
extension=gd.so
extension=hash.so
extension=json.so
extension=mysqli.so
extension=pdo.so
extension=session.so
extension=simplexml.so
extension=xml.so
extension=curl.so
extension=tokenizer.so

I even upgraded from php 5.6.25 to php 7.0.10 but get the same result.

If I run “php -m” on the command line, tokenizer is in the list and if it
comment it out in /usr/local/etc/php/extensions.ini, it is no longer in the
list.

Could somebody please help?

OS: FreeBSD-10.2
Web Server: nginx-1.10.1


#2

Additional information:

I discovered also that the global php.ini file is apparently also not
getting loaded for some reason. This may be related.

phpinfo() shows

Configuration File (php.ini) Path /usr/local/etc Loaded Configuration File (none)

Yet the file is there

$ ls -l /usr/local/etc/php.ini -r--r--r-- 1 root wheel 69087 Sep 18 13:40 /usr/local/etc/php.ini

#3

This is about the best thing I could find to help.

http://stackoverflow.com/questions/10711698/php-ini-is-nonexistent-loaded-configuration-file-none


#4

eureka! I found the problem.

Thank you astonecipher, for attempting to help but it turned out to
be a user malfunction.

I kept wondering why I was getting different results between “php -i” from
the command line and “phpinfo()” from the browser.

Turns out I had restarted nginx but forgot about the php-cgi processes.
I finally noticed that phpinfo() still showed the older version of php.
So even though I had installed the newer php package, the old php-cgi
processes, that nginx talks to to run php scripts, were still running.
I had to restart the fcgiwrap service.

It is all working now :).


#5

Glad you figured it out!