• Resolved Griffinit

    (@griffinit)


    I am tring to debug not being able to log in to WordPress desktop. It is loading the plug ins that gives the problem. I can only load 6 plug ins, the error arises trying to load the 7th (regardless of which plug-ins are loaded). I am getting the following error message on debug:

    Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 2621440 bytes) in /home/networkm/public_html/text/wordpress/wp-admin/includes/file.php on line 1675

    The code around this is:

    function _unzip_file_ziparchive( $file, $to, $needed_dirs = array() ) {
    	global $wp_filesystem;
    
    	$z = new ZipArchive();
    
    	$zopen = $z->open( $file, ZIPARCHIVE::CHECKCONS );
    
    	if ( true !== $zopen ) {
    		return new WP_Error( 'incompatible_archive', __( 'Incompatible Archive.' ), array( 'ziparchive_error' => $zopen ) );
    	}
    
    	$uncompressed_size = 0;
    
    	for ( $i = 0; $i < $z->numFiles; $i++ ) {
    		$info = $z->statIndex( $i );
    
    		if ( ! $info ) {
    			return new WP_Error( 'stat_failed_ziparchive', __( 'Could not retrieve file from archive.' ) );
    		}
    
    		if ( str_starts_with( $info['name'], '__MACOSX/' ) ) { // Skip the OS X-created __MACOSX directory.
    			continue;
    		}
    
    		// Don't extract invalid files:
    		if ( 0 !== validate_file( $info['name'] ) ) {
    			continue;
    		}
    
    		$uncompressed_size += $info['size'];
    
    		$dirname = dirname( $info['name'] );
    
    		if ( str_ends_with( $info['name'], '/' ) ) {
    			// Directory.
    			$needed_dirs[] = $to . untrailingslashit( $info['name'] );
    		} elseif ( '.' !== $dirname ) {
    			// Path to a file.
    			$needed_dirs[] = $to . untrailingslashit( $dirname );
    		}
    	}
    
    
    

    In that code line 1675 is:

    if ( true !== $zopen ) { return new WP_Error( 'incompatible_archive', __( 'Incompatible Archive.' ), array( 'ziparchive_error' => $zopen ) );

    I cannot see how/why I’m getting memory size exhausted. There is plenty of room on the disc. Is it a setting in Worpress?

    • This topic was modified 1 year, 1 month ago by Griffinit.
    • This topic was modified 1 year, 1 month ago by Griffinit.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Fatal error: Allowed memory size of 41943040 bytes exhausted

    Your PHP config allows only 41943040 bytes or 42MB per script. That’s abysmally small for today’s CMSes.

    You can increase this in your php.ini, or in your WordPress wp-config.php file.

    I cannot see how/why I’m getting memory size exhausted. There is plenty of room on the disc. Is it a setting in Worpress?

    This is about memory (RAM) and not disk/storage space. And it’s not about how much you have installed, but how much your software (PHP in this case) is allowed to use.

    Good luck!

    Thread Starter Griffinit

    (@griffinit)

    @gappiah Thanks. I assigned 64MB and this has cured the issue. All plug-ins now activated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Exceeding Memory Size’ is closed to new replies.