0

I am by all means a Magento beginner so please bear with me. A magento setup I am working on and took on from another developer is very slow. When I try to store Magento Mega Menu extension items I often get a premature end of header.

[Tue Sep 15 02:26:29 2015] [error] [client xx.xxx.xxx.xxx] client denied by server configuration: /home/user/prelaunch.domain.com/app/etc/local.xml

This seems to be a general security message that access to local.xml was denied. See https://stackoverflow.com/questions/4360574/magento-client-denied-by-server-configuration

[Tue Sep 15 02:33:35 2015] [error] [client xx.xxx.54.211] Premature end of script headers: index.php, referer: http://prelaunch.domain.com/index.php/megamenuadmin/adminhtml_megamenu/new/key/7cf1b32b81e34985672110ff82385750/
    [Tue Sep 15 02:52:11 2015] [error] [client xx.xxx.54.211] Premature end of script headers: index.php, referer: http://prelaunch.domain.com/index.php/megamenuadmin/adminhtml_megamenu/new/key/7cf1b32b81e34985672110ff82385750/

This is often when there is another error or lack of RAM and this .phprc

; {{{ The following lines were automatically added by DreamHost
extension=xcache.so
; }}} That's all from DreamHost
max_execution_time = 18000
max_input_time = 120
memory_limit = 512M

. I do have plenty of RAM.. Perhaps another configuration change needed?

I turned on error logging and this error came to my attention:

2015-09-15T09:52:42+00:00 ERR (3): Recoverable Error: Object of class

Mage_Catalog_Model_Resource_Product_Collection could not be converted to string  in

/home/user/prelaunch.domain.com/app/design/frontend/rwd/default/template/page/custom.phtml on line 20

On that line I have

echo '&emsp;' . '<a href="' . $_categoryChildModel->getUrl() . '"' . $bold . '>' .  $_categoryChild->getName() . '' . $_categoryChildModel->getProductCollection() . '</a>';

Working out what the data being echoed is at the moment. Full code here https://gist.github.com/jasperf/5ed4a6d835c876b1c0e8

Other notices/warnings I see are:

2015-09-15T09:56:22+00:00 ERR (3): Notice: Undefined variable: cookieParams  in 
/home/user/prelaunch.domain.com/includes/src/__default.php on line 7693

referring to this block of code with some commented out data:

// session cookie params
/* $cookieParams = array(
        'lifetime' => $cookie->getLifetime(),
        'path'     => $cookie->getPath(),
        'domain'   => $cookie->getConfigDomain(),
        'secure'   => $cookie->isSecure(),
        'httponly' => $cookie->getHttponly()
    );
  */

        if (!$cookieParams['httponly']) {
            unset($cookieParams['httponly']);
            if (!$cookieParams['secure']) {
                unset($cookieParams['secure']);
                if (!$cookieParams['domain']) {
                    unset($cookieParams['domain']);
                }
            }
        }

and this warning

2015-09-15T09:56:22+00:00 ERR (3): Warning: call_user_func_array() expects parameter 2 to be array, null given  in 

/home/user/prelaunch.domain.com/includes/src/__default.php on line 7707

referring to

call_user_func_array('session_set_cookie_params', $cookieParams);

Not sure if these errors are directly related to the issue at hand with the site being really slow in storing data and loading frontend, but would love to debug this error and or sort the notices and warnings and could use some help.

4
  • $_categoryChildModel->getProductCollection() looks problematic. Not sure why a product collection would be fetched there and definitely could not be converted to a string.
    – Smartie
    Commented Sep 15, 2015 at 10:30
  • Same custom.phtml seems to be here inchoo.net/magento/custom-category-menu-navigation-in-magento for a custom category menu so seems like their code was used unless inchoo got it from elsewhere again.
    – rhand
    Commented Sep 15, 2015 at 10:38
  • The client denied by server has the ip of the server the site is hosted on. Perhaps this is an issue after all.
    – rhand
    Commented Sep 15, 2015 at 11:27
  • Related issue I am checking out here stackoverflow.com/questions/13933766/…
    – rhand
    Commented Sep 15, 2015 at 11:34

1 Answer 1

1

Besides the recoverable error I did manage to get rid of the premature header ending by emptying all caches, turning on Lesti FPC. After that I no longer had failures storing menu items and so no premature ending of headers. So that solved the issue.

NB The recoverable error has not been fixed, but as it is recoverable I can attend to it later on or open a new question on it.

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.