1

I know that there are a lot of topic concerning the famous error 500 but i didn't find my answer in one of them.

Actually i have an error 500 when i load admin/people/permissions or when i'am trying to save new permissions. It's not all the time but i will say that it happens 80% of the time. This permission page is very slow to load and when i haven't this error, it takes my navigator between 30s to 1m to display it.

I used google developper tools for this page and the result of the audit was:

36 requests ❘ 138.40KB transferred ❘ 27.57s (onload: 27.27s, DOMContentLoaded: 25.58s)

I edit my post and follow the trick that gave me H.NiK and i have impressive result for now

38 requests ❘ 17.09KB transferred ❘ 2.34s (onload: 1.76s, DOMContentLoaded: 1.42s

I have a lot of fields on the permission page more than 150 i think (because of the module fields permissions).

I watch the log of my server and i just have the same information:

Premature end of script headers: index.php, referer: http://blabla.com/admin/people/permissions

I have 25 lines of this today on this page.

Have you any idea why i have this error only appears on this page?And maybe how i can track this error and resolve my problem? Is it possible that a module or a js file trigger this error?

ps: i'm on a shared hosting, so i can't touch any configuration on my server (php.ini,my.ini)

Thanks,

6
  • try liquidweb.com/kb/apache-error-premature-end-of-script-headers -- it can be any number of reasons, including a resource limit on the shared hosting
    – zerolab
    Commented Aug 31, 2012 at 14:32
  • Thanks for all the advice...I made a test with ini_get('max_execution_time') and i have 120. I don't know if this value is good or not but i haven't a dedicated server so i can't touch the php.ini file. Is it possible to put a ini_set directly at the beginning of page.tpl.php to try to change this value without any (bad) repercution for Drupal (we never know)?
    – Epok
    Commented Aug 31, 2012 at 14:37
  • @Epok It won't have any negative effect on Drupal to increase PHP settings via ini_set, but if you're on shared hosting I'd be really surprised if you're allowed to set your own scripts' execution time from PHP. They normally have that locked down. The other thing to check (which I guess you can't) is the max_allowed_packet setting in my.cnf
    – Clive
    Commented Aug 31, 2012 at 15:02
  • @Clive it's weird but it seems that i can change it but when i put my code in page.tpl.php ini_set('max_execution_time',200);echo ini_set('max_execution_time') nothing works...But when i put this code in a test.module that i created last month in my function test_form_alter it's works, it displays me 200! For max_allowed_packet i send a message to see if they can give me my exact configuration.
    – Epok
    Commented Aug 31, 2012 at 16:11
  • 1
    The PHP process may also be running out of memory if it is on shared hosting. I had this problem before, the drupal bootstrap would fail during page builds.
    – Rider_X
    Commented Aug 31, 2012 at 16:18

2 Answers 2

2

Because you are on shared hosting the PHP process may not be given enough memory. If you have a complex site or page the drupal bootstap may run out of memory and fail. I have had this problem trying to run a heavy site (one of the more Drupal complex distributions) on a shared host. I would take a quick peak at how much memory is given to a PHP process (and Drupal) by visiting admin/reports/status and look for the "PHP Memory Limit". I typically use 128M on a complex site.

You said also you can't edit you php.ini file - are you certain? Many shared hosts allow you to to override the global php.ini file with one in your account. Most will have a wiki explaining how configure such overrides. If not you may need to move to a different host.

3
  • Thx for your help, i visiting admin/reports/status and i already have this configuration: PHP memory limit : 128mo --- php version : 5.2.17 --- node access permissions: 166 permissions in use. I have many roles and permissions, on certains pages it's pretty complexe. (in permissions page the amount of field maybe crashed the site) I will ask to my host if i can have more memory (256?) But you said that 128mo is enough so i don't now if it's really the problem.
    – Epok
    Commented Aug 31, 2012 at 16:56
  • I said that generally 128 M is enough, but I would hesitate to say this is true for all possible complex configurations. Also have you checked your database for any corrupt tables? You can do this with PHPMyAdmin which most shared hosts provide.
    – Rider_X
    Commented Aug 31, 2012 at 19:10
  • I succeded in changing the memory limit of php (i put 256mo). I tried all the technique write in this article but all failed (error 500). So i tried what @Clive said early and i put ini_set('memory_limit', '256M'); in the index.php and it works. Now i have 256mo in admin/reports/status. I know that we must not change the core but for now i will do like that, make some test and see if i have progress on my website. Thxs
    – Epok
    Commented Aug 31, 2012 at 20:23
0

Try the Filter permissions module.

This module provides filters at the top of the Permissions page for easier management when your site has a large amount of roles and/or permissions.

1
  • +1 It was not the answer i was hoping but it works very well, my page is a lot faster and doesn't crash when i load it. I need to make some test but for now it's a good solution even he doesn't really resolve the problem (he hide it)...Thx
    – Epok
    Commented Aug 31, 2012 at 16:04

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.