michaeluno / admin-page-framework

Facilitates WordPress plugin and theme development.
http://admin-page-framework.michaeluno.jp/
Other
337 stars 71 forks source link

Memory size problem #233

Closed mnajafzadeh closed 8 years ago

mnajafzadeh commented 8 years ago

I get the following error when using Admin Page Framework on my website:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 76 bytes) in /wp-content/plugins/social-board/library/admin-page-framework/factory/_abstract/utility/base_utility/AdminPageFramework_Utility_Array.php on line 47

I think this should be related to array variable memory limit or kind of that. What is the solution?

Thank you.

michaeluno commented 8 years ago

Which method is it with the line 47?

mnajafzadeh commented 8 years ago

I have this method: Line 47 is in bold.


    public static function uniteArraysRecursive($aPrecedence, $aDefault) {
        if (is_null($aPrecedence)) {
            $aPrecedence = array();
        }
        if (!is_array($aDefault) || !is_array($aPrecedence)) {
            return $aPrecedence;
        }
        foreach ($aDefault as $sKey => $v) {
            if (!array_key_exists($sKey, $aPrecedence) || is_null($aPrecedence[$sKey])) {
                $aPrecedence[$sKey] = $v;
            } else {
                if (is_array($aPrecedence[$sKey]) && is_array($v)) {
                    $aPrecedence[$sKey] = self::uniteArraysRecursive($aPrecedence[$sKey], $v);
                }
            }
        }
        return $aPrecedence;
    }

michaeluno commented 8 years ago

I guess you just hit the PHP memory allocation limit.

You can increase it by putting this in wp-config.php.

define( 'WP_MEMORY_LIMIT', '256M' );

(see https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP)

michaeluno commented 8 years ago

Closing the topic as this is not the issue of the framework.