Tuesday, November 8, 2016

Is your Drupal 8 site crashing on PHP 7?

I ran into this problem on a Drupal 8 site running on bleeding edge technology. The site would not come up and it would display an error coming from Symfony "Request.php".
It turns out that PHP 7 has some cool performance features including a feature where PHP will not create the standard global variables (like $_SERVER) if it doesn't see any references to them in the PHP code. The problem was that there were references to the global variables in Symfony, but there were no references within "index.php", so Symfony would crash the drupal site when it tried to access the $_SERVER global variable.
A quick fix was to add this line to index.php: "$server = $_SERVER;" and the site was up and running.

1 comment:

  1. Every time you lose a hand at an Oklahoma casino, you will double your current guess plus an additional amount equal to your original guess. While this might make a more significant impression in your bankroll, the payout will be much larger when you 1xbet do win. Roulette certainly one of the|is among the|is likely considered one of the} latest video games in Oklahoma casinos, legalized lower than two years ago. Many gamers find roulette to be a straightforward yet exciting sport to participate in after they head to the casino. First issues first, you need to|you should|you have to} get the hunt in query.