DMXzone Security Provider PHP Support Product Page

Under investigation

Premature end of script headers

Reported 29 Apr 2014 07:05:39
1
has this problem
29 Apr 2014 07:05:39 Steven Irwin posted:
When I add Site Security to a Template Bootstrap page I get a 500 internal error page.
When I check my server logs I see the following error:
Premature end of script headers: main.php, referer:

It seems that the php script above the DOCTYPE tag is causing problems.
The web server is running Apache php with FastCGI.

Url will be provided on request via email.

Replies

Replied 01 May 2014 09:21:07
01 May 2014 09:21:07 Teodor Kuduschiev replied:
Hello Steven,
Please create a blank php file with the following content inside:
<?php
phpinfo();
?>

Then please upload it to your server and send the link to
Please also attach the page you are having the issue with.
This reply was removed on 5/1/2014 11:03:13 AM.
See the changelog
Replied 01 May 2014 11:10:36
01 May 2014 11:10:36 Steven Irwin replied:
Hi Teodor,

Email sent as requested
Replied 05 May 2014 23:30:03
05 May 2014 23:30:03 Steven Irwin replied:
This was resolved by using CGI for the php handler.
I now have an issue (reported elsewhere) where the permissions are not working. I am using a field in the users table named group_id which identifies the user group. There are 2 groups, 1 - User, 99 - Admin.
When I setup 2 permissions in security provider (User, Admin) the permissions are not being applied. A page setup with security enforcer that is supposed to allow Admin access is not allowing any access. This was reported elsewhere but there seems to be no activity on that fault.
Replied 06 May 2014 00:02:38
06 May 2014 00:02:38 Steven Irwin replied:
Problem is back: Premature end of script headers: cgi_wrapper

This is using the php cgi handler.

Arrrrrrrgggghhhh!!!!
Replied 06 May 2014 00:07:08
06 May 2014 00:07:08 Steven Irwin replied:
It seems the problem is that if you are not logged in you get the error. If you are already logged in (via another page that doesn't have the security enforcer) you are then redirected as if you were unauthorized.

I am at a loss.
Replied 06 May 2014 09:18:25
06 May 2014 09:18:25 Teodor Kuduschiev replied:
Hello Steven,
The Premature end of script headers: cgi_wrapper can be caused by many reasons - permissions or some setting in the cgi configuration.
It is better to contact your hosting provider and ask them what exactly causes the issue.
Replied 06 May 2014 09:27:15
06 May 2014 09:27:15 Steven Irwin replied:
Hi Teodor,
Another piece of the puzzle:
It only happens when there is no cookie or it has expired.

The problem is only with the security page enforcer and has a problem with CGI, Apache, or FastCGI php handlers.

I will see if the hosting provider can shed some light although it is the server log that I am getting the information from.
Replied 06 May 2014 12:25:18
06 May 2014 12:25:18 Steven Irwin replied:
Teodor,

I have accessed the apache eror log and can see the following error:
exit signal Segmentation fault(11)

This only occurs when there is no cookie or the user is logged out. If the user is logged in the page redirects (due to the permissions error I have also reported)
Replied 08 May 2014 02:52:50
08 May 2014 02:52:50 Steven Irwin replied:
This is the feedback from my hosting provider:

When I attempt to run the file with PHP manually on command line, it simply segfaults.

Unfortunately there's not much information you can get from a problem like this. The best I can do is trace the process while it runs to see what the last thing it does it before the segfault.

I've done this and it appears as though the last PHP file accessed is httpdocs/ScriptLibrary/dmxSecurityProvider/dmxDatabaseSecurityProvider.p
hp. The process then begins working with MySQL just before it crashes.

As a test, I commented out the 6 lines at the top of this file which refer to the above script. Once they were commented out, the page loads without issue.

I've removed the comments, but you'll need to look through the script and do some further troubleshooting to find where it's failing. If possible, finding a different script which has the same function might be your best solution.


I have tested the site on a local developer server and similar issues are apparent - the main difference is that instead of a 500 server error it is a blank page. This only occurs when there is no current user logged in. When a user is logged in then the page always redirects regardless of the user permission setting.

Note that this site has 2 problems logged against it which are interacting here.
Replied 08 May 2014 08:43:37
08 May 2014 08:43:37 Teodor Kuduschiev replied:
Hello Steve,
Thanks for the information provided. We are looking into this issue.

Reply to this topic