10

Everything works except the /node/[nr]/edit page of only one content type page. And it's not for every page of this specific content type. Only one.

So let's say I have a content type "product" and created 5 nodes with that content type. Editing 4 of them works but for one the error 500 Premature end of script headers: index.php occurs.

I tried increasing the memory limit in the php.ini all the way up to memory_limit = 1024M (and restarted apache after that) but this changes nothing. Btw I'm using Acquia DevDesktop and the PHP version is 7.0.15. I also tried downgrading the PHP version (and there also increased the memory limit) but this won't do anything either.

Please help me, I'm incredibly thankful for every answer I can get!

4
  • If this is only happening for one node, my guess would be that the content of this node causes a recursion and you run out of memory.
    – 4uk4
    Commented Dec 8, 2017 at 14:16
  • Hm no, it doesn't seem to do that.
    – elterr1ble
    Commented Dec 9, 2017 at 16:09
  • 1
    @elterr1ble were you able to find the solutions, I'm having same issue with my site as well. Commented Jun 4, 2018 at 7:21
  • @SukhjinderSingh see Nookeen's answer below. This did it for me!
    – elterr1ble
    Commented Nov 28, 2018 at 12:09

5 Answers 5

5

This is not "solve it all" answer, but it may help those who use Acquia. The problem went away after switching from Fast CGI (mod_fcgid) to Apache module (mod_php) in Acquia DevDesktop->Preferences->Config.

Just some env notes for future debugging:
Acquia DevDesktop 2 rev:39801a8
PHP version 7.2.9

0
33

@mcaleaa answer helped me on an acquia based site. To fix it I commented out the following lines in development.services.yml.

parameters:
  http.response.debug_cacheability_headers: true
2
  • 1
    You could also change from true to false.
    – Harish ST
    Commented Apr 4, 2022 at 12:07
  • This issue can happen on any site, and as far as I know is not related specifically to acquia in any way.
    – jdhildeb
    Commented Jan 22 at 21:37
8

In case this helps anyone: I encountered this error on my local site's front page, just after following the instructions here https://www.drupal.org/node/2598914 (Disable Drupal 8 caching during development)

When I once again commented out this line in my settings.local.php, the 500 error went away:

# $settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';

I suspect that my site's front page is heavily dependent on the cache entries, and when I switch to the null cache, the page is simply having trouble getting built. That's my guess.

UPDATE 2022-02-16 There is a issue on drupal.org dealing with this problem: https://www.drupal.org/node/2844620

We have been using the patch from that issue for a couple of years now, to deal with this error message during local development:

Premature end of script headers: index.php
2
  • This was not the case in my case, so hope for more answers.
    – Nookeen
    Commented Oct 29, 2018 at 22:24
  • I've found that adding $settings['php_storage']['twig']['directory'] = '/path/to/writable/tmp/sites-caching/php'; directory cleared the error too, in addition to the above. Commented Jan 8 at 18:43
0

I am using drupalVm and was able to make the switch to using nginx. This was helpful for us cause our site is hosted by pantheon which uses nginx. You'll need these values set in your extra parameters: fastcgi_buffers and fastcgi_buffer_size. My config.yml looks like this:

drupalvm_webserver: nginx
...
nginx_hosts:
  - server_name: "{{ drupal_domain }} www.{{ drupal_domain }}"
  ...
  extra_parameters: |
    ...
    fastcgi_buffers 16 16k;
    fastcgi_buffer_size 32k;
0

In my case, SVG files in my blocks are causing the error. The error went away after replacing them.

1
  • Can you please provide a little bit more detail how these SVG got placed there, how you removed them and what these SVG looked like?
    – leymannx
    Commented Apr 6, 2021 at 6:51

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.