1

I have a very strange problem with a fresh Drupal install: On some pages, I receive a WSOD with ERR_EMPTY_RESPONSE:

WSOD

It happens for instance when on admin/config/development/performance I click Clear all caches. (But also other pages are affected – for instance the Layout Builder page of a Node type.)

Interestingly, I could isolate the bug down here: If in vendor/symfony/http-foundation/Response.php::sendHeaders() I tweak the code so that it unsets a lot of the headers to be sent (actually, all of them but X-Generator and X-Frame-Options), the error disappears.

...
$headers = $this->headers->allPreserveCaseWithoutCookies();
unset($headers['Cache-Control']);
unset($headers['Content-language']);
unset($headers['Date']);
unset($headers['X-Drupal-Dynamic-Cache']);
unset($headers['X-UA-Compatible']);
unset($headers['X-Content-Type-Options']);
unset($headers['Expires']);
unset($headers['Vary']);
foreach ($headers as $name => $values) {
  ... 

Based on the headers I unset, it seems that it is a caching-related problem. (However, Caching is switched off, Browser and proxy cache maximum age is set to <no caching>.)

My setup:

  • installed Drupal 8.7.5 via composer
  • on my local machine, a MacBook Pro with macOS High Sierra
  • installed via Homebrew
    • PHP 7.3
    • Apache 2.4
    • MySQL 5.7.24

Any idea what the problem might be?

Edit: Regarding Apache error logs: I first had no entries there but now I debugged again and saw such one:

[core:notice] [pid 92592] AH00052: child pid 98466 exit signal Bus error (10)

Googling gave the suggestion to apc_clear_cache(); but it's not available in PHP7. So I ran opcache-reset().

Result: Problem is still there, now already when opening the page admin/config/development/performance.

Now the error logs say:

 [core:notice] [pid 7428] AH00052: child pid 7446 exit signal Segmentation fault

Google suggests this is likely caused by a syntax error in php.ini or some included extension there. Thus I have taken out all extensions, including

zend_extension=/usr/local/opt/php/lib/php/20180731/opcache.so

but the problem remains.

Edit 2: Here's the output of my php -i (It uses the same php.ini file as phpinfo() in localhost). https://pastebin.com/ppvCpPA6

  • 1
    This might be easier to debug if you find the error log of the Apache instance you've installed via Homebrew and post the error message. – 4k4 Aug 9 at 9:39
  • 1
    Wouldn't it be better to have OPcache disabled completely when developing locally? – leymannx Aug 9 at 11:34
  • 1
    Thanks, just disabled it with opcache.enable=0 in php.ini, problem remains. – Georg Jähnig Aug 9 at 11:47
  • 1
    Be sure that your /usr/local/etc/php/7.3/conf.d/ext-opcache.ini doesn't override your php.ini, see stackoverflow.com/q/27640772/2199525. – leymannx Aug 9 at 12:12
  • 1
    Yes, I'm sure, it only contains this commented out line: ;zend_extension=/usr/local/opt/php/lib/php/20180731/opcache.so – Georg Jähnig Aug 9 at 12:21
1

Now I could solve it myself. My Apache error logs did show

AH00052: child pid 7363 exit signal Segmentation fault (11)

so it must have been a problem with the Apache config.

I took the opportunity to reinstall Apache and configure it with FCGI/FPM according to this and now the problem is gone.

  • 1
    Hurray!!!!!! :) – leymannx Aug 15 at 15:50
0

I have same issue with set debug mode when run

drupal smo dev

Problem will gone If I set to prod mode

 drupal smo prod

After sometime debug I found problem because cache tag header. And I change

http.response.debug_cacheability_headers: true

to

http.response.debug_cacheability_headers: false

It's working again.

  • 1
    Didn't know what smo meant. Where exactly did you change these tags? – leymannx Aug 9 at 11:38
  • @Jonh: Thanks, drupal smo prod gave me PHP Fatal error: Declaration of Drupal\Component\DependencyInjection\Container::set($id, $service) must be compatible with Symfony\Component\DependencyInjection\ContainerInterface::set($id, $service, $scope = self::SCOPE_CONTAINER) in /Users/jorge/data/my/code/test/d8/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 49 – Georg Jähnig Aug 9 at 12:05
  • 1
    @leymannx Grepping gave me core/core.services.yml – but my value is already false there. – Georg Jähnig Aug 9 at 12:06
  • @GeorgJähnig, the initial value in core.service.yml can be overwritten in /sites/default/services.yml or /sites/development.services.yml, the 2nd one only when enabled in settings.php, which is usually the case for dev modes, see drupal.stackexchange.com/questions/251768/… – 4k4 Aug 9 at 13:02
  • @4k4 OK, thanks! I have no sites/default/services.yml file (nor development.services.yml), and even the default.services.yml (which I guess has no effect) has only a http.response.debug_cacheability_headers: false line. – Georg Jähnig Aug 9 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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