• When I try to acces a gallery in the admin backend with more then 75.000 images a memory limit error occurs in the server log.

    When I check the server limit with the phpinfo() function in php it is 512M (set it this high, which is large!!)
    But when I access the dashboard of the nextgen-gallery the server settings seem to be changed in 512 . Where did the “M” go?

    Operating System : Linux (32 Bit)
    Server : Apache
    Memory usage : 32.43 MByte
    MYSQL Version : 5.5.42-cll-lve
    SQL Mode : Not set
    PHP Version : 5.4.37
    PHP Safe Mode : Off
    PHP Allow URL fopen : On
    PHP Memory Limit : 512
    PHP Max Upload Size : 64M

    Is there somewhere in the nextgen-gallery files a setting that cuts the M of the memory causing a memory shortage when accessing the serialized large gallery?

    https://wordpress.org/plugins/nextgen-gallery/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Vakantie Ameland

    (@christianebuddy)

    Changed the memory_limit in php.ini from 512M to 512000000 and this value is shown in the nextgen-gallery dashboard server settings.

    PHP Memory Limit : 512000000
    PHP Max Upload Size : 64M

    By the way, in wp-config.php the memory limit is accordingly

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

    But still a memory error occurs when the gallery of > 75000 images is accessed in the backend

    PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 2048 bytes) in ../wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_driver_base.php on line 120

    How can this happen as the php memory on the server is 512M ( and it really is when checking with a “phpinfo()” file) ?

    Thread Starter Vakantie Ameland

    (@christianebuddy)

    This is a workaround the problem: the memory limit in the admin section has to be raised

    define('WP_MAX_MEMORY_LIMIT', '1024M'); in wp-config.php

    then the gallery can be shown in the admin backend.

    but this still does not solve the dissappeared M in the dashboard server settings and the php memory json_decode error in the datamapper class.

    As I understand, json_decode happens in memory; with a large gallery a lot of memory is used. I have read some forum suggestions about using a parser of your own converting the object in memory to an array or something like that trying to avoid the memory problem. Like here http://forums.phpfreaks.com/topic/288266-json-encode-exceeds-allowed-memory/ Hopefully this helps the developers?

    Plugin Contributor photocrati

    (@photocrati)

    @vakantie Ameland – We simply do not display the “M” … as to the actual limit issue. It seems rather odd you would have to use such a high setting. Also to note, some web hosting services simply have a non-user modifiable limit set no matter what value you try to assign, have you verified that is not the case here?

    – Cais.

    Thread Starter Vakantie Ameland

    (@christianebuddy)

    @cais tnx for your answer. the M puzzle has been solved now 😉

    About the high settings, this is the setting that works

    `define(‘WP_MEMORY_LIMIT’, ‘128M’);
    define(‘WP_MAX_MEMORY_LIMIT’, ‘512M’);

    Lower values then these do not work anymore. I completely control the server, so everything is modifiable.

    Loading of a page with 40 images from the huge gallery (has grown to over 135000+ images now) on the frontend takes more then 100 seconds. Load on the server is not stressful, just 2 on a 4 core CPU.
    When loading a page with 40 images from a smaller gallery (< 10000 images) the page loads in less then 10 seconds.

    So I guess json_decoding the data string takes a lot of time / memory

    Plugin Contributor photocrati

    (@photocrati)

    @vakantie Ameland – Thanks for the updates … we will have to look further into large scale gallery as the ones you are describing.

    I’ll ask our developers to have a look at this topic so they can get a sense of what you are seeing.

    – Cais.

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

The topic ‘Memory Limit not according to PHP server settings’ is closed to new replies.