Announcement

Collapse
No announcement yet.

End of script output before headers: index.php | Premature end of script headers: index.php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • End of script output before headers: index.php | Premature end of script headers: index.php

    Hi All,

    some of our users complain about random "Internal Server errors" on ther Joomla 1.5/2.5/3.4 or Wordpress pages.

    In the /usr/local/apache/logs/error_log I see the following errors:
    <code>
    [Wed Apr 29 10:04:25.120285 2015] [core:error] [pid 240710] [client x.x.x.x:49174] End of script output before headers: index.php, referer: http://otherdomain.com/wp-login.php
    [Tue Apr 28 12:59:29.325574 2015] [core:error] [pid 649284] [client y.y.y.y:57294] Premature end of script headers: index.php, referer: http://domain.com/index.php?page=shop.cart&amp;option=com_virtuemart&Itemid=1
    </code>

    Some use PHP 5.3, some php 5.4 (both via cagefs). System is a CentOS 6.5 with cPanel and CloudLinux.

    Any suggestions I should check? (Ive already checked the statistics and I don see any problems there.

  • #2
    Hello,

    We have no ready answer for you, this needs to be investigated on the server, better to create a ticket and our support will help you.

    Are there any other errors in /usr/local/apache/logs/*log ? Also, what php mode is used? Show us the output of "/usr/local/cpanel/bin/rebuild_phpconf --current"

    Comment


    • #3
      Hi,

      were still facing this issue, more of our customers reports it on multiple servers, all running CentOS 6.x with cPanel (latest stable).

      The occurance of the Internal Server Error is random and not reproducable. The customer acts in the Joomla backend, clicks on a menu item, gets a HTTP 500 ISE, refreshes and voilá, the page loads without error.

      There are no other errors in apache/suphp/suexex log

      Im a qualified system administrator, so I can debug a few things if someone points me to the right direction. What is the best way to debug this? Can I somehow attach to the corresponding apache process?

      Thanks,

      Tom

      Comment


      • #4
        Do you use any RLimits in apache configs? Any results with:

        Code:
        grep -i RLimit /usr/local/apache/conf* -Rs
        Still would like to see your setup with:

        Code:
        /usr/local/cpanel/bin/rebuild_phpconf --current

        Comment


        • #5
          Yes, there are some - cPanel default - RLimits in the config:

          Code:
           root@ponpon [~]# grep -i RLimit /usr/local/apache/conf* -Rs
          
          /usr/local/apache/conf/httpd.conf:RLimitMEM 1153433600
          
          /usr/local/apache/conf/httpd.conf:RLimitCPU 240
          
          /usr/local/apache/conf/httpd.conf:ServerLimit 256
          
          /usr/local/apache/conf/httpd.conf,v:RLimitMEM 1153433600
          
          /usr/local/apache/conf/httpd.conf,v:RLimitCPU 240
          
          /usr/local/apache/conf/httpd.conf,v:ServerLimit 256
          
          /usr/local/apache/conf/httpd.conf,v:RLimitMEM 1153433600
          
          /usr/local/apache/conf/httpd.conf,v:RLimitCPU 240
          
          root@ponpon [~]# free
          
          total       used       free     shared    buffers     cached
          
          Mem:      12169516   11929912     239604      46708     561572    2246976
          
          -/+ buffers/cache:    9121364    3048152
          
          Swap:      2097148       5276    2091872
          
          root@ponpon [~]#
          My setup is:

          Code:
           root@ponpon [~]# /usr/local/cpanel/bin/rebuild_phpconf --current
          
          Available handlers: suphp dso cgi none
          
          DEFAULT PHP: 5
          
          PHP4 SAPI: none
          
          PHP5 SAPI: suphp
          
          SUEXEC: enabled
          
          RUID2: not installed
          
          root@ponpon [~]#
          CageFS is also installed.

          Comment


          • #6
            Please remove RLimitMEM and RLimitCPU from /usr/local/apache/conf/httpd.conf and restart apache. As far as I know cPanel will not add them back with apache config file rebuild so it is Ok to edit it directly. I bet they are the core of the issue.

            Comment


            • #7
              Thank you Bogdan. Ive disabled RLimit via WHM (WHM >> Main >> Service Configuration >> Apache Configuration >> Memory Usage Restrictions), Ill report back the results.

              If you have some spare time, can you please explain a bit how is that RLimit can be a core issue?

              Comment


              • #8
                I remember I have seen such errors with RLimits enabled. And, searching with google almost all articles says the same. Another point is that issue is happening not regularly, but sometimes.

                Let me know how it goes without RLimits.

                Comment


                • #9
                  Im still waiting for our customers feedback. As soon as Ive enough feedback Ill get back to the forum.

                  Comment


                  • #10
                    Unfortunatelly the issue still exists Just bumped into it myself with a joomla backend.

                    Comment


                    • #11
                      I am still sure issue has something to do with rlimits.. But, please open a support ticket with us and we will check it in place.

                      Comment


                      • #12
                        Issue solved with the help of the support, it was due to and old setting in CSF/LFD, which killed the users app if they reached a certain memory level (not needed with cloudlinux). Thanks for your support Bogdan.

                        Comment


                        • #13
                          Good to hear that, and thanks for the update!

                          Comment


                          • #14
                            Hi Tamas DAJKA,

                            What you did exactly, I have the same issue?

                            Cpanel support couldnt help me.

                            BR

                            Comment


                            • #15
                              I suppose it was resolved with whitelisting php in /etc/csf/csf.pignore file.

                              But also following two options from /etc/csf/csf.conf file should be checked: PT_USERRSS , PT_USERMEM .

                              Comment

                              Working...
                              X