• Resolved moonwoff

    (@moonwoff)


    I tried to load up a image (in a post) and this message came
    Fatal error: Out of memory (allocated 44564480) (tried to allocate 4672 bytes) in /customers/bluechalo.com/bluechalo.com/httpd.www/wp2/wp-includes/media.php on line 253“.

    What is wrong? What do I have to do, so I can post images?

    My page.

    Thanx in advance!

    Media.php-file:

    function wp_load_image( $file ) {
    	if ( is_numeric( $file ) )
    		$file = get_attached_file( $file );
    
    	if ( ! file_exists( $file ) )
    		return sprintf(__('File “%s” doesn’t exist?'), $file);
    
    	if ( ! function_exists('imagecreatefromstring') )
    		return __('The GD image library is not installed.');
    
    	// Set artificially high because GD uses uncompressed images in memory
    	@ini_set('memory_limit', '256M');
    	$image = imagecreatefromstring( file_get_contents( $file ) );
    
    	if ( !is_resource( $image ) )
    		return sprintf(__('File “%s” is not an image.'), $file);
    
    	return $image;
    }

Viewing 6 replies - 1 through 6 (of 6 total)
  • Try increasing the memory available to PHP:
    http://wordpress.org/support/topic/253495#post-1017842

    Thread Starter moonwoff

    (@moonwoff)

    I just find out that I find the photos uploaded (?) in the library.
    What are they doing there and how do I get them uploaded directly to the post? Is it really the size that is the problem or is it somehow some linking problem?

    The file address for the image is this
    http://bluechalo.com/wp2/wp-content/uploads/2010/10/auto13.jpg

    I can´t not find a PHP.ini-file anywhere…

    Moderator James Huff

    (@macmanx)

    As stated in the error and alluded to by esmi, there is not enough memory allocated to PHP for the process to be completed.

    If you’re seeing this error either suddenly (no specific task was done to cause the error) or frequently, try deactivating all plugins to rule-out a plugin-specific issue and try switching themes to rule-out a theme-specific issue.

    Otherwise, here are four ways to increase PHP’s memory allocation:

    1. If you’re using WordPress 2.9.2 or lower, try adding define('WP_MEMORY_LIMIT', '256M'); to your wp-config.php file. If you’re using WordPress 3.0 or higher, WordPress automatically does this for a variety of tasks, so there’s really no reason to try it in this case.

    2. If you can edit or override the system php.ini file, increase the memory limit. For example, memory_limit = 256M

    3. If you cannot edit or override the system php.ini file, add php_value memory_limit 256M to your .htaccess file.

    4. If neither of these work, it’s time to ask your hosting provider to temporarily increase PHP’s memory allocation on your account. Keep in mind that most decent hosting providers allocate 32 MB to PHP under each account, and most decent hosting providers allow users to temporarily increase the memory allocation. If your hosting provider won’t accommodate you, perhaps it’s time to find a new hosting provider.

    Thread Starter moonwoff

    (@moonwoff)

    Okey, as I already said, I don´t know where to find that php.ini-file. =o( Where should I find it?

    I am using Sandbox theme. (I am not familiar with it).

    It didn´t changed eventhough I deactivated the plugins (the only one I am using is “Widget Logic”). And also changed the theme back to Twenty Ten 1.1.

    As I said, why does the image at all come to the library (in the admin panel). Is it not uploaded then? Or what is happened?

    Moderator James Huff

    (@macmanx)

    Okey, as I already said, I don´t know where to find that php.ini-file. =o( Where should I find it?

    It varies depending on hosting provider, so you’ll have to either contact your hosting provider or try one of the other three methods.

    As I said, why does the image at all come to the library (in the admin panel). Is it not uploaded then? Or what is happened?

    There was not enough memory allocated to PHP for the upload and insert process to be completed. It’s impossible to say exacty where it stopped, but from your description I’d say it was uploaded, but didn’t make it to the insert media prompt.

    Thread Starter moonwoff

    (@moonwoff)

    Gaaah, I had not checked out that the image was small enough (I thought it was, since it was in such a folder).
    So it was “so simple” that the image I was trying to upload was too big. *embarressed*

    Thanx anyway!

    There was not enough memory allocated to PHP for the upload and insert process to be completed. It’s impossible to say exacty where it stopped, but from your description I’d say it was uploaded, but didn’t make it to the insert media prompt.

    Okey, I didn´t know that all images are gone to library (I don´t use that, have just uploaded in the posts before this)…

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Can not load images’ is closed to new replies.