Solved php-cgi ?

In my ongoing problems trying to get Drupal 8 working, the latest error revealed in my apache logs is
Code:
Fatal error: Call to undefined function token_get_all()
which appears to be the same problem experienced by another FreeBSD user.
Details here:-

https://www.drupal.org/node/2801947

A solution is posted.....
I kept wondering why I was getting different results between "php -i" from the command line and "phpinfo()" from the browser.

It turned out that 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.
... unfortunately this means nothing to me. I'm using Apache and am not aware of any php-cgi process. Anyone know what I need to do?

I noticed that when running php -m that tokenizer was not listed, so maybe that is the problem. How do I install it?
 
Have you got the tokenizer extension enabled? (Edit: Just read your last line...)

By default if you install php on FreeBSD it disables everything. You can use the lang/phpXX-extensions port to install any extensions you need (or use pkg although you need to install each extension separately with the package system).

With Apache php is normally loaded into the Apache process, so just restarting it is enough. With Nginx, you have to have a separate pool of php processes to handle php requests. Because of this restarting Nginx will not reload php and so config or extension changes won't take effect.
 
Ah yes, I was thinking that the extensions port is specifically designed to let you choose extensions and that you obviously can't do that with the package. As you say, the package will just install all the extensions that are enabled by default in the port.

You could argue that most users should probably pkg install phpXX phpXX-extensions if they want to install PHP. The way the FreeBSD packages are designed allows you to install PHP and then choose just the extensions you want, but unless you plan to install specific extensions that you need, installing both will probably give you an install more like what you'd get by installing PHP from source (not that you should on FreeBSD these days).
 
I now know there is a devel/php56-tokenizer and that it is required for Drupal 8. I have now installed it, and the Drupal setup screen comes up. Not sure why installing Drupal doesn't automatically install all the dependent pkgs... although I have never needed to install it previously.
 
Not sure why installing Drupal doesn't automatically install all the dependent pkgs.
It might not be listed as a dependency, have a look with pkg info -d drupal. If it's not listed as a dependency, when it's required for the application to run, the port needs to be adjusted.
 
There is no mention of php56-tokenizer for Drupal 8, although I don't recall needing to add this pkg when I installed Drupal 8 elsewhere some months ago. Maybe it's been added recently....
 
Yeah, that's possible. It could have been added with the last update, which is probably why it was overlooked as a new dependency.
 
Back
Top