1&1 = 3 ???

21Mar08

In the last weeks several users report a failure of NextGEN Gallery. All of the users are using a web hosting of 1&1, current environment is : Apache/1.3.34 Ben-SSL/1.55 PHP/4.4.8

These users are not able to generate thumbnails (the script suddenly stopped) or get a memory failure message. The phpinfo() returns a memory_limit of 40 MB, normally enough for a 1600x 1400 resolution in a WordPress environment.

Thanks to Nana Torres, I’m able to debug this on a 1&1 web server and after 5 hours I found that imagecreatefromjpeg() stopped if you require more than 20 MB. This happened very early , when you uses a larger images. UPDATE : See FAQ

You can test this on your machine, with the attached script. If you see at the end a “*** SCRIPT END ***” your are not having the troubles…

Download 1&1 Test script
Simple PHP script

1&1 failure - THE SCRIPT STOPPED My own server - LOOK FOR THE ***SCRIPT END*** !!!

Update : See comment of Philip D. , PHP5 seems to do the work…

64 Responses to “1&1 = 3 ???”


  1. Gravatar Icon 1 Xarj Posted March 21st, 2008 - 19:04

    And what if I am having trouble with 1&1? Anything I can do?

    Thanks for the help

    Xarj

  2. Gravatar Icon 2 MajorShadow Posted March 21st, 2008 - 19:25

    I’ve got this problem, too.
    There is no “Script End”…

    Any solution?

    Thanks alot!

  3. Gravatar Icon 3 alakhnor Posted March 21st, 2008 - 19:30

    It can be even worse depending on jpg encoding…

  4. Gravatar Icon 4 alex.rabe Posted March 21st, 2008 - 19:52

    @Xarj & majorShadow
    You can onyl contact 1&1 and give them the script or a note, maybe they found the reason. I’m using here PHP 4.4.7 with a limit of 32 Mb and it works…

    @alakhnor
    Yes this could be, but a script should not stop without any error message…

  5. Gravatar Icon 5 alakhnor Posted March 21st, 2008 - 20:22

    That some of the nightmares I had with post-thumb…
    Then you can try to handle memory but as you’ve seen, sometime, gd has its own limits.
    Then some servers just won’t let you handle memory. Or you would have to have different routines depending on php version, server OS or php configuration.
    Usually, when memory reaches its limit with a gd function, you end up with a blank page when you expect php to return a memory error.

    For 1&1, I’m also hosted there and I have the same kind of trouble (some images which are running fine with my local install and low memory – 24M or lower) can just not be thumbnailed on my site which is suposed to have 40M available. Go figure.
    As far as I can understand what’s going on with the server, if it’s shared, then memory management goes nut because it will interact with other users who are hosted on the same server. I haven’t found any workaround for this…

  6. Gravatar Icon 6 alex.rabe Posted March 21st, 2008 - 20:31

    Yes it’s a hassle with GD & web hoster…one reason why I try to integrate for v1.00 also Imagemagick. Let’s see what for a nightmare with this script :)

  7. Gravatar Icon 7 alex.rabe Posted March 21st, 2008 - 20:33

    Let me note that I have also a shared web, with a limit of 32MB, here its ok. I feel 1&1 should have a look for it, it’s some PHP setup problem.

  8. Gravatar Icon 8 EotS Posted March 22nd, 2008 - 00:13

    Hey Alex,

    I’m just getting in on this, having the same problem. Thanks for the support and what looks to be a great plugin.

    I’m also 1&1 with the environment:

    Server Settings

    * Operating System : Linux
    * Server : Apache/1.3.34 Ben-SSL/1.55
    * Memory usage : 6.7 MByte
    * MYSQL Version : 5.0.51-log
    * SQL Mode : Not set
    * PHP Version : 4.4.8
    * PHP Safe Mode : Off
    * PHP Allow URL fopen : On
    * PHP Memory Limit : 40M
    * PHP Max Upload Size : 20M
    * PHP Max Post Size : 8M
    * PHP Max Script Execute Time : 50000s
    * PHP Exif support : Yes ( V1.4 )
    * PHP IPTC support : Yes
    * PHP XML support : Yes

    I cannot upload a single image, it freezes on thumbnails 0% (they are big 2600 x 1940.)

    However – I ran your test script and it worked fine (?)

    It ended with:

    Mean fudge factor: 0
    *** SCRIPT END ***

  9. Gravatar Icon 9 Dalkiel Posted March 22nd, 2008 - 08:56

    about the memory problem i got it too but changing the size of the images seems to work just fine and i finaly have uploaded some images again

  10. Gravatar Icon 10 Philipp D. Posted March 22nd, 2008 - 19:58

    Hi,

    we had the same problem. We just found out that it worked for us using PHP5, which is also available with 1&1…

    We put a .htaccess file containing:
    AddType x-mapp-php5 .php

    in the directory of the wordpress…

    Hopefully this can help you as well.

    Greets
    Philipp

  11. Gravatar Icon 11 MajorShadow Posted March 22nd, 2008 - 21:37

    @Philipp D.

    Great! Works fine!

    Thanks alot!

    Alex

  12. Gravatar Icon 12 clarezoe Posted March 23rd, 2008 - 00:15

    My server settings
    * Operating System : Linux
    * Server : Apache/2.0.61 (Unix) PHP/4.4.7 mod_ssl/2.0.61 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2
    * Memory usage : 9.25 MByte
    * MYSQL Version : 5.0.24a-standard-log
    * SQL Mode : Not set
    * PHP Version : 5.2.3
    * PHP Safe Mode : Off
    * PHP Allow URL fopen : Off
    * PHP Memory Limit : 90M
    * PHP Max Upload Size : 7M
    * PHP Max Post Size : 8M
    * PHP Max Script Execute Time : 30s
    * PHP Exif support : Yes ( V1.4 )
    * PHP IPTC support : Yes
    * PHP XML support : Yes

    Script ends with
    Mean fudge factor: 1.6750302044117
    *** SCRIPT END ***

    still got the memory error, I tried only one picture at a time, it works fine, but the picture became so ugly.

    any help?
    Thanks!

  13. Gravatar Icon 13 Xarj Posted March 23rd, 2008 - 12:33

    OMG !! It works!!
    @Philipp D got it right!

    You can fix this annoying problem with 1&1
    Check the article :

    http://www.thecodecave.com/article206

    NextGen Gallery works like a charm now! I don’t have to resize my photos to 1200 pixels! Youpiiii

    Xarj

  14. Gravatar Icon 14 Daniel Hüsken Posted March 24th, 2008 - 08:43

    I have many contact withe 1und1 I become an “Server Error” with an other script 1und1 have not only the 32MB limitation as secont the script exec time is max. of 10 sec. It’s not depending on php.inni setings, because you kan make your own php.ini.

  15. Gravatar Icon 15 romain Posted March 24th, 2008 - 15:59

    THX Philipp D!!

  16. Gravatar Icon 16 csgyuricza Posted March 24th, 2008 - 19:44

    I followed the instructions above and now WP is using PHP 5.2.5 but I am still having the same problem. When I try to import the images from an existing folder, it says “Create new thumbnails” and when it reaches 7% it stops.

    My server settings:

    Server Settings

    * Operating System : Linux
    * Server : Apache/1.3.34 Ben-SSL/1.55
    * Memory usage : 6.54 MByte
    * MYSQL Version : 5.0.51-log
    * SQL Mode : Not set
    * PHP Version : 5.2.5
    * PHP Safe Mode : Off
    * PHP Allow URL fopen : Off
    * PHP Memory Limit : 40M
    * PHP Max Upload Size : 20M
    * PHP Max Post Size : 8M
    * PHP Max Script Execute Time : 50000s
    * PHP Exif support : Yes ( V1.4 )
    * PHP IPTC support : Yes
    * PHP XML support : Yes

    GD support

    * GD Version : bundled (2.0.34 compatible)
    * FreeType Support : Yes
    * FreeType Linkage : with freetype
    * T1Lib Support : No
    * GIF Read Support : Yes
    * GIF Create Support : Yes
    * JPG Support : Yes
    * PNG Support : Yes
    * WBMP Support : Yes
    * XPM Support : No
    * XBM Support : Yes
    * JIS-mapped Japanese Font Support : No

  17. Gravatar Icon 17 csgyuricza Posted March 25th, 2008 - 00:07

    I contacted 1&1 and they were unable to find the problem. I put a php.ini with the same settings under the following folders:

    (uiserver):u36513900:~/mydomain/wordpress >
    (uiserver):u36513900:~/mydomain/wordpress > ls -l php.ini
    -rw-r–r– 1 u36513900 ftpusers 62 Mar 24 18:57 php.ini
    (uiserver):u36513900:~/mydomain/wordpress > cat php.ini
    upload_max_filesize=40M
    memory_limit=40M
    post_max_size=40M
    (uiserver):u36513900:~/mydomain/wordpress > cd wp-admin
    (uiserver):u36513900:~/mydomain/wordpress/wp-admin > ls -l php.ini
    -rw-r–r– 1 u36513900 ftpusers 62 Mar 24 18:58 php.ini
    (uiserver):u36513900:~/mydomain/wordpress/wp-admin > cat php.ini
    upload_max_filesize=40M
    memory_limit=40M
    post_max_size=40M
    (uiserver):u36513900:~/mydomain/wordpress/wp-admin > cd includes/
    (uiserver):u36513900:~/mydomain/wordpress/wp-admin/includes > ls -l php.ini
    -rw-r–r– 1 u36513900 ftpusers 62 Mar 24 18:58 php.ini
    (uiserver):u36513900:~/mydomain/wordpress/wp-admin/includes > cat php.ini
    upload_max_filesize=40M
    memory_limit=40M
    post_max_size=40M
    (uiserver):u36513900:~/mydomain/wordpress/wp-admin/includes >

    Now my server settings for Nextgen read:

    * Operating System : Linux
    * Server : Apache/1.3.34 Ben-SSL/1.55
    * Memory usage : 6.54 MByte
    * MYSQL Version : 5.0.51-log
    * SQL Mode : Not set
    * PHP Version : 5.2.5
    * PHP Safe Mode : Off
    * PHP Allow URL fopen : Off
    * PHP Memory Limit : 40M
    * PHP Max Upload Size : 40M
    * PHP Max Post Size : 40M
    * PHP Max Script Execute Time : 30s
    * PHP Exif support : Yes ( V1.4 )
    * PHP IPTC support : Yes
    * PHP XML support : Yes

    But I am *still* having the same problem… image import stops loading after about 7 seconds…

    Does anyone have any idea how to fix this?

  18. Gravatar Icon 18 elokaze Posted March 25th, 2008 - 12:16

    I have follow instructions and the situation is better. The test run now ok and more pics are uploaded.
    But I’m still having the same problem with, for exemple a 3569×2376 pic.
    The BIGEST problem is the pic is uploaded and no more pic can be uploaded until the bad pic is present.
    On a WPMU isntall it’s impossible to manage.
    Is there a solution to remove the problem or to delete bad pics when the error appears ?

  19. Gravatar Icon 19 alex.rabe Posted March 25th, 2008 - 12:20

    @elokaze

    I’m think of a better memory check and skipping images. Currently it’s in a more relaxed mode, so some images could get passed. More over, I try with ini_set to increase the memory limit (which is accepted, but the hoster still uses the old limit). There is some need to rework this…

  20. Gravatar Icon 20 Beth Posted March 26th, 2008 - 15:27

    I am on 1&1 and am having the same issue, but I’ve upgraded to PHP 5.2.5 and it does NOT work.

    I’m not sure if this is related to the same problem, but I also cannot import WP XML files either – stalls just like the thumbnails.

  21. Gravatar Icon 21 jim Posted March 26th, 2008 - 16:49

    Can Phillip D or someone please detail the steps for adding the .htaccess file?

    Should the file ONLY contain the text AddType x-mapp-php5 .php?

    Should it go in the root WP directory?

    And if I already have a .htaccess file, can I just add the new line of code to it?

    Thanks!

    I use 1and1 and so far things are still working well. Images upload and thumbnails get created. But my galleries seem to take longer to load.

  22. Gravatar Icon 22 Beth Posted March 26th, 2008 - 17:36

    Yes, just add that line at the end of your current file. You can check if you made the upgrade ok, by looking at your Gallery Summary.

    Personally, this didn’t fix the issue for me. I’m hoping there is a fix because this is for a client’s setup.

  23. Gravatar Icon 23 jim Posted March 27th, 2008 - 00:09

    Thanks Beth! Is there any downside to doing this or can I revert by removing that line if necessary?

    I don’t think I’m having the same issues because I always prepare my images at 800 x 600 prior to upload, and try not to upload too many at a time.

  24. Gravatar Icon 24 and Posted March 28th, 2008 - 16:53

    I placed the code in the .htaccess file but now i get a ‘Fatal error: Out of memory’ error on the thumbnail page when i try to upload image larger then 1 meg or so..

    Can anyone guide me on how to fix this? is there away to increase my memory allocation? pretty in experienced with php so not quite sure what needs to happen there.

    Thanks for any help

  25. Gravatar Icon 25 Raul Lorenzo Posted March 28th, 2008 - 18:03

    Hello Alex and All,

    I am having trouble all the sudden with Nextgen, it is not “reading” the images, either in the thumbs or pic’s, a white square with a red X is all I get, and of cours4e not view on the site. However am looking at them through the FTP Client files, and I got an answer from my host (dreamhost….not much of a dream now..) and said every thing was fine….
    I dropped the tables, reinstalled everything….nothing
    Could somebody help me, will appreciate it
    Thanks
    Raul

  26. Gravatar Icon 26 Mark Posted March 29th, 2008 - 09:38

    Hi Alex,

    Thanks for the support, I would like to try this script if it has indeed been working for others on 1&1, as I am having the same thumbnail stopping thing happening with a site I’m working on (www.antheamay.com)

    I have downloaded the script, but what now, where do I put it?
    Sorry, I’m not a professional, rather hobbyist who knows a thing or two, but would like to know where to place the script for it to work?

    Your advise would be a life-saver
    !

    Thank you so much,

    Mark

  27. Gravatar Icon 27 Aleks Posted March 30th, 2008 - 05:49

    1&1 isn’t the only one having problems. I can confirm this on BlueHost as well.

  28. Gravatar Icon 28 Clint Posted March 30th, 2008 - 09:24

    I’ve just upgraded to WordPress 2.5 and have upgraded nextgen gallery to .91, but my thumbnails aren’t showing up for my galleries. On the post I’m using [gallery=id], like it was before, but that isn’t working. Any ideas?

    Thanks!

  29. Gravatar Icon 29 Raul Lorenzo Posted March 31st, 2008 - 00:23

    Hello Mark,

    You have to put the folder inside any folder through your FTP Client in your server, example, wp-contents folder, then in your browser you have “to call it”, like this….

    http://mysite.com/wp-contents/memory/test.php

    and it will run, it is just a debugging file, that will test your memory….
    In my case it gave me an excellent memory of 90 M, and ended up with the ****SCRIPT END****….However I still donot see my thumbnails, just in an album where there are 3 pic’s…
    I think another plugin recently loaded have done some interference…in the presentation set….like AjaxEd….

  30. Gravatar Icon 30 Dirk Melchers Posted March 31st, 2008 - 01:13

    I did not succeed with 1&1 with big pictures (about 3.2 MB). I always get errors about “can not alloc mem…”. Smaller images work without any problems.

    Maybe this is the problem:

    http://faq.1and1.com/scripting_languages_supported/php/16.html

    Even if you try to increase the memory_limit in an php.ini, 1&1 will not give you more than 20MB (my error msg show 33.5 MB – but that may be wrong)

    Best regards,

    Dirk.

    PS: i will change the hoster for my Blog now – it took me the whole evening… :-(

  31. Gravatar Icon 31 Aleks Posted March 31st, 2008 - 02:06

    The new version of NextGEN should work. It did for me.

  32. Gravatar Icon 32 tobi Posted March 31st, 2008 - 16:34

    hey,

    I made the proposal quite a while back ago in the forum also:

    Isn’t it possible to integrate a function to NextGEN, which checks the image size before uploading? When pics are bigger than a certain amount of kilobytes nextgen can’t handle the thumbnailing process and throws an error message. If there would be the function to check the image size before uploading and setting a maximum image size in the settings of nextGEN according to what is possible on the webspace that is used, there wouldnt be a problem any more with this. I think many users are experiencing those problems cuz many webhosters in the low budget area are limiting php memory.

    I’m really hoping for such a new feature in the nextGEN gallery, so that my authors would just receive a pop-up with “Sorry, the picture you try to upload is too large in size, please resize it before trying again” instead of uploading it, and then failing on the thumbailing-process and leaving behind lots of “dead data” that I have to clean up afterwards ;-)

    cu
    tobi

  33. Gravatar Icon 33 alex.rabe Posted March 31st, 2008 - 16:41

    @tobi

    it’s possible AFTER upload to get the image size BEFORE I start thumbnail process. And indeed I will work on a update in this direction. Currently I have taken the memory_limit as limit , but as we can see the limit is sometimes not the limit as I receive from the PHP environment.

    The “real” problems is also written in Alkahnor’s comment, I don’t get sometimes a error message so I can’t handle is correct…

  34. Gravatar Icon 34 Raul Lorenzo Posted March 31st, 2008 - 19:45

    Alex,

    There is nothing like your plugin in the WordPress enviroment, I have WPMU, it was running fine, until something happened, that I posted before, it is not reading the pic’s, jpg or else…
    pictures are on the tables, and in the server files….

    I uploaded Simple Galleries from wp-simpleviewer, it works fine out of the box….however, nothing like yours. it have to be loaded on a page or post, not in the side bars,cannot in the header, no widgets, no slideshow….

    If you take a look at this plugin, it reduces the size of the original pic, and creates a “reg” file and a “tm” (tumbs file) much smaller than the actual size….

    Just as a Suggestion, I think if you work around this “set-up” it will reduce the mem limit, and it may work….also it doesnot create tables?….work with XML files….and quality is great, when calling the option “view larger size photo”…

    Regards

    Raul

  35. Gravatar Icon 35 Mark Posted April 1st, 2008 - 09:31

    Hi there,

    Thank you Raul for your advice on loading script. It comes back with 40MB limit.

    I have a folder with some pics I have uploaded to the gallery via ftp that has a combined size of 4.87MB. I have updated to latest wordpress and latest ngGallery BUT when I click scan folder for new images it idles at 0% and NOTHING HAPPENS????

    When I checked the thumbs folder I noticed that some thumbnails had been created!? But these don’t show up on the site’s gallery either!?

    I am with 1&1, what is the problem? what can I do? I am in desperate need for help asap, please??!!

    Mark

  36. Gravatar Icon 36 nik Posted April 1st, 2008 - 15:25

    I have just tried the Philipp D suggestion and can confirm that it has totally resolved the issue for me at least. Before I could upload the images but the thumbnails were not created

    For reference after I made the change my .htaccess file looks like this.

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /words/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /words/index.php [L]

    # END WordPress

    AddType x-mapp-php5 .php
    AddHandler x-mapp-php5 .php

    The text between the # marks is created by WordPress, it is the AddType and AddHandler lines that enables PHP 5. For safety sake make sure you take a copy of this file before you make the changes.

  37. Gravatar Icon 37 David Posted April 3rd, 2008 - 21:13

    Hi,

    Any solution?
    When i tried to change my .htaccess file, my ftp client said i not have permission to change this file.
    I put .htacces file in the wordpress directory, but dont works.
    I´ll be trying…

    ¿Anyone can help me?
    Thanks, a lot.

  38. Gravatar Icon 38 tobi Posted April 5th, 2008 - 21:23

    hey alex,

    yeah it would be a really nice feature at least if the plugin would check after the upload if the image is small enough that resizing (or thumbnailing) will work or cause an error. If the pic is too big, the pic should be deleted automatically and a message should be promted to tell the user to use a smaller image. This would have the same effect as a check before uploading (except of the longer loading time ;-))

    By the way: Quo vadis Next Gen? I think its way better than the “gallery” feature of WP 2.5 which isnt a real gallery (I think so)

    Thanks for the work!

    tobi

  39. Gravatar Icon 39 Eric Posted April 10th, 2008 - 16:37

    OMG… the post at http://www.thecodecave.com/article206 really made the difference and now everything works. Thank you to all for figuring that out.

  40. Gravatar Icon 40 Brenda Posted April 18th, 2008 - 00:09

    Hello,

    I am having this 1&1 issue as well with a friends site I’m working on. I changed my .htaccess file using nik’s example and am now getting an error during the thumbnail generation piece.

    Fatal error: Out of memory (allocated 33292288) (tried to allocate 3008 bytes) in /homepages/3/d135461664/htdocs/wsb3871804201/dev/wp-content/plugins/nextgen-gallery/lib/thumbnail.inc.php on line 183

    Has anyone dealt with this after the .htaccess fix? My server settings are below as well.

    * Operating System : Linux
    * Server : Apache/1.3.34 Ben-SSL/1.55
    * Memory usage : 6.9 MByte
    * MYSQL Version : 5.0.51-log
    * SQL Mode : Not set
    * PHP Version : 5.2.5
    * PHP Safe Mode : Off
    * PHP Allow URL fopen : Off
    * PHP Memory Limit : 40M
    * PHP Max Upload Size : 20M
    * PHP Max Post Size : 8M
    * PHP Max Script Execute Time : 50000s
    * PHP Exif support : Yes ( V1.4 )
    * PHP IPTC support : Yes
    * PHP XML support : Yes

  41. Gravatar Icon 41 Brenda Posted April 18th, 2008 - 00:37

    My apologies for not noticing this before I posted. The file I uploaded was 2.7 Mb but I noticed that the error indicated that 33292288 allocated, which converts to around 32mb. The file uploaded but no thumbnail was created. Is the process trying to use 32MB to generate the thumb?

    Thanks,
    Brenda

  42. Gravatar Icon 42 patrick Posted April 18th, 2008 - 06:11

    @ Phillip D or whoever can answer:
    since there’s already an .htaccess file in the WordPress directory, do i add said code to the existing .htaccess? where should it go?

  43. Gravatar Icon 43 jim Posted April 23rd, 2008 - 01:01

    nik: thanks for that!

    It WAS getting pretty ugly for me — couldn’t even generate thumbnails for very small images (220kb)! Added the extra code to my .htaccess file and now, so far so good.

    Only my file looks slightly different. Perhaps because I’m running a different WP version (2.2.2):

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    AddType x-mapp-php5 .php
    AddHandler x-mapp-php5 .php

    Eric: Thanks for that link too! Here’s how I confirmed I was running PHP5 after the .htaccess edit …

    Create a file in the WP root directory called “phptest.php” that just includes the following:

    Open this file in your browser to see what version of PHP you’re running.

  44. Gravatar Icon 44 jim Posted April 23rd, 2008 - 01:03

    D’oh! My php code got stripped out. Duh …

  45. Gravatar Icon 45 patrick Posted April 29th, 2008 - 18:19

    now experiencing exactly the same problem as Brenda (posted above). i have tried every step suggested above and still struggling. any fix?

  46. Gravatar Icon 46 bw Posted April 30th, 2008 - 13:50

    i have the site hosted on a dedicated server and have access to the php.ini and global settings. What needs to be changed to get this o work? currently my memory limit is 40MB but i cant understand why that is not enough?

    When i upload new images the thumbnails are created automatically without any problems but when i try to do a batch resize (even just on a single photo) using the ‘manage gallery’ screen i get the classic error message that everyone else is getting telling me that my 40MB mem limit has been reached.

    When resizing a sngle picture surely 40MB is more than enough memory to cope, i dont think that is the problem here. Even if i change the settings to 10×10 and quality 10% the batch resizer gves memory limit errors which is not right.

    As i said… automatic generation of thumbnails works fine?

    Also test script works fine only using something like 700kb of memory.

  47. Gravatar Icon 47 Trey Posted May 8th, 2008 - 23:54

    I’m having the same problem as Brenda and am also on 1&1. I actually started out having errors of not enough memory. Following some of the advice posted on several different forums (to include this one), because these servers are running Apache in CGI mode, I added a php.ini file to my main blog directory and the wp-admin directory with the following lines.

    upload_max_filesize = 50M
    post_max_size = 40M
    memory_limit = 48M

    That got me to the point of hanging at 0% and the script above didn’t complete. After adding the specified lines to a new .htaccess file in the two directories, I’m not getting the this error on the thumbnail page:

    Fatal error: Out of memory (allocated 35127296) (tried to allocate 12288 bytes) in /homepages/35/d93152625/htdocs/blog/wp-content/plugins/nggallery/lib/thumbnail.inc.php on line 183

    Any ideas?

  48. Gravatar Icon 48 Marc Posted August 7th, 2008 - 05:34

    From the 1and1 website:

    Can the memory usage limit be increased on shared hosting with a php.ini file?

    Due to resource limits on our Shared Hosting machines, it is not possible to allocate more than 20M
    of memory to PHP, although phpinfo() may report a higher number. You will be unable to increase
    the memory usage limit with a php.ini file.

    I think we;re pretty much screwed here… the easy answer is to resize under 1280*1024 — any bigger is a waste for a photo gallery anyways.

  49. Gravatar Icon 49 alex.rabe Posted August 7th, 2008 - 10:35

    @Marc

    very interesting. Have you a link from the 1&1 webpage ?

  50. Gravatar Icon 50 kim Posted October 28th, 2008 - 19:06

    I use your fantastic plug-in on at least a dozen sites hosted on 1&1. I experienced the thumbnail generation problem regardless of my small (500x375_100kb) pics.
    I was able to resolve the issue which had completely frozen uploads, by ‘deactivating’ all the plug-ins.
    I turned the plug-ins back on one at a time and ended up leaving two off permanently. In my case a maintenance mode plug-in somehow caused the issue.

    Just a thought, check the plug-ins you are using.

    The thumbnail generation problem only happened, to me, in 2 of 12 sites over the past two years on 1&1 servers.

  51. Gravatar Icon 51 DarkClown Posted November 9th, 2008 - 04:14

    Well, using 1&1 as well, I carefully read through all the comments and ended up with still having the same problem (soloution does not seem that easy!) … extended my .htaccess files … checked, that I’m using PHP5 … and still I can’t upload ZIP files … folders are generated on my server, but no files are uploadeed. script seems to abort.

    I have no clue what to do next. I tried uploading zip files with VERY small JPG Files (in KB size and dimensions) – no help … I never get to a successful upload. No even get to the thumbnail problem.

    Any help would be more than appreciated …
    DarkClown

  52. Gravatar Icon 52 luky37 Posted January 12th, 2009 - 23:12

    Somehow my php + gd was lacking JPEG support.
    The script aborts and generates a error in the apache error logfile (PHP Fatal error: Call to undefined function imagecreatefromjpeg()).
    Compiling php with both gd and jpeg support fixed this.

    The only problem however is that not every user has access to the apache error log and debugging this problem can take time.

    Thats why i think you should implement a check at the beginning of the script, which checks weather imagecreatefromjpeg is defined or not.
    As simple check like this would be huge time saver (not only for the users):

  53. Gravatar Icon 53 luky37 Posted January 12th, 2009 - 23:17

    my post was truncated, this is the code:
    if(!(function_exists(‘imagecreatefromjpeg’))) die(“Call to undefined function imagecreatefromjpeg!\n”);

  54. Gravatar Icon 54 Razor Posted March 13th, 2009 - 08:36

    I’ve got my clients websites on 1and1 servers, abd i’ve used a .htaccess addition on the root of the WP directory to fix the problem : edit yout .htaccess and add the line:

    AddType x-mapp-php5 .php

    it worked fine on images’ size 600x800px max.

  55. Gravatar Icon 55 marie Posted March 25th, 2009 - 19:12

    Hi alex and everyone,

    So i did the test 1&1 and everything is fine.
    That is helping me to smile a bit.
    But my nextgen gallery is very strange anyway as (online):
    - it is not working
    - in the admin section I try to change a value in a textfield it looks like it is ok but it never create anything (folder, path, thumbnail) or doesn’t detect the images in the directories.
    (everything works perfectly in local).
    It looks like it doesn’t manage to read or write informations.

    Any idea? I am looking around and just panicked when I see some comments and 1/2 of my website rely on it.
    Please… I want it to work !!

  56. Gravatar Icon 56 padma Posted November 5th, 2009 - 13:34

    I am using gallery in wpmu.
    In admin blog/site http://www.example.com thumbnails are generated without failure
    But for other uer like http://www.example.com/aa thumbnails creation goes to failure

    Is there problem of PHP memory?
    As on admin blog it works fine n on the other user blog it gives failure

  57. Gravatar Icon 57 visitor Posted January 22nd, 2010 - 17:02

    there is one post regarding this problem:

    german:
    (Die 3 MB pro JPEG-Bild sind PHP völlig egal, intern wird mit Pixelbreite * Pixelhöhe * 3 Byte gerechnet. Bei 7 Megapixel z.B. wird also für die Verarbeitung 21 MB PHP-Speicher benötigt!)

    It says:

    The size of the image is not important.
    PHP checks the resolution of the image and tries to allocate memory like this:

    IMG_WIDTH * IMG_HEIGHT * 3 bytes

    Ex: 7 Megapixel needs 21 MB

    – hmm –

    I have this problem at 1und1 webhosting and images like 700kb and 2000 x 1500 px wont be thumbed. I have php5 and ini_set enabled in the gd-script.
    PHP Version : 5.2.12
    GD Version : bundled (2.0.34 compatible)
    # PHP Memory Limit : 40M
    # PHP Max Upload : 20M
    # PHP Max Post : 8M
    # PHP Output Buffer : N/A
    # PHP Max Script Execute Time : 50000s

    mem_usage on ngg-dash 17.34 MByte

    Images with 1024×768 px work perfect.

    – In the end I have no clue :-] –

    I hope someone will find a solution for this.

    tx again for this nice plugin

  58. Gravatar Icon 58 Greg Posted August 5th, 2011 - 07:28

    I am trying to get this running for a client on 1&1. I see the latest comment was from 2010, but I have this problem now. I get the standard out of memory error as everyone before. I uncommented the ini_set line. The test script runs fine. Any ideas?

  59. Gravatar Icon 59 Joey Posted November 29th, 2011 - 20:25

    Hello all! I found this to be very helpful for those still having issues. Hope it helps!!

    http://www.visser.com.au/blog/thumbnail-generation-php-memory-limit-nextgen-gallery/

Who's linking?

  1. 1 KK4YOU » Blog Archive » Uploadproblem mit Hoster 1&1 Pingback on Mar 24th, 2008
    "[...] Anwendern. Der Fehler wurde von Alex inzwischen gefunden und in seinem Blog unter dem Titel 1&1=3 auch veröffentlicht. Ohne …"
  2. 2 Scenic Indiana » Blog Archive » NextGen 1&1 Prob SOLVED Pingback on May 9th, 2008
    "[...] http://alexrabe.de/2008/03/21/11-3/ [...] "
  3. 3 Understand GD Library at alex.rabe Pingback on May 13th, 2008
    "[...] have a look at your Memory Limit in the server settings and you can calculate the maximum resolution for your images, …"
  4. 4 Kalvan.org » Blog Archive » Irony Pingback on Jul 10th, 2008
    "[...] to say, they didn’t load in this gallery either. I did some searching and quickly found this post by …"
  5. 5 GD Library Probleme bei 1und1 : MiZine Pingback on Oct 6th, 2009
    "[...] weiterlesen geht es hierlang Share this on del.icio.usSubscribe to the comments for this post?Tweet This!Add this to Mister [...] "
Comments are currently closed.