1 & 1 – Read the FAQ

In response to my article 1&1 = 3.

Marc found this interesting note in the FAQ section of 1 & 1 :

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.

Very cool note 🙂 Especially when you are check the memory limit via your PHP script. Time to change the hoster…

Advertisements
Tagged , ,

8 thoughts on “1 & 1 – Read the FAQ

  1. dan says:

    i’ve switched from 1&1 to domainfactory one week ago. there you’ve got your own php.ini file in nearly all packages. i like domainfactory 🙂 if you want to switch to, let me know, so that i could send you an promotion code 😉

  2. alex.rabe says:

    Thanks Dan,

    but I’m not hosted by 1&1 and when I read such a FAQ, I will never use it 🙂

  3. Esteban says:

    hi, im talking because i have nextgen and is a wonderfull plugin for my page, the problem i have is everybody tellme the photos take a lot of time to load, can you help me with tis please? thanks

  4. I’m using Rapidweaver, is there any way to get wordtube to work with Rapidweaver, I’m looking all over the web for a plugin that looks this great, but can’t find one.
    thanks
    JL

  5. James says:

    Hi Alex fantastic website and awesome plugins. I have a issue with your NextGen Gallery plugin – actually it is probably a case of PEBKAC really lol.

    My website is http://www.jamesapps.com and on my portfolio page I am using your plugin: http://www.jamesapps.com/portfolio/ and on the page im using:

    [album=4,extend]

    [album=5,compact]

    But for some reason I can’t get the thumbnails to display on the page, can you help me please.

    Also I really love your website and I was wondering what plugins you use? Especially how you got the AJAX page slider for your home page.

    Looking forward to your response.
    Kind regards
    James

  6. […] zu installieren, und dem Fehler somit zurande zu kommen, kam ich schließlich auf die Lösung über Alex’ Post, der mich anfänglich nciht wirklich weiter – aber auf die richtige Spur […]

  7. Manolo says:

    I have tried with the solution described in the forum to run PHP5 instead of 4… and it seemed that the situation improved… but still the memory limit is there and the script gets blocked before creating all the thumbs.
    Since I wanted to use nextgen and I am not willing to move from 1and1, I have tried to find a “solution” – yeah, it is not a very nice solution, but it works.
    I have introduced a pretty dummy function so 1and1 users can still use nextgen
    1- The modifications in nextgen (Sorry Alex, I did not want to mesh with your code)
    a. In the functions.php file (nextgen-gallery/admin/wp25/) you need to add this function:

    function import_gallery1and1($galleryfolder) {
    // ** $galleryfolder contains relative path

    //TODO: Check permission of existing thumb folder & images

    global $wpdb;

    $created_msg = “”;

    // remove trailing slash at the end, if somebody use it
    if (substr($galleryfolder, -1) == ‘/’) $galleryfolder = substr($galleryfolder, 0, -1);
    $gallerypath = WINABSPATH.$galleryfolder;

    if (!is_dir($gallerypath)) {
    nggallery::show_error(__(‘Directory’, ‘nggallery’).’ ‘.$gallerypath.’ ‘.__(‘doesn`t exist!’, ‘nggallery’));
    return ;
    }

    // read list of images
    $new_imageslist = nggAdmin::scandir($gallerypath);
    if (empty($new_imageslist)) {
    nggallery::show_message(__(‘Directory’, ‘nggallery’).’ ‘.$gallerypath.’ ‘.__(‘contains no pictures’, ‘nggallery’));
    return;
    }

    // check & create thumbnail folder
    if ( !nggallery::get_thumbnail_folder($gallerypath) )
    return;

    // take folder name as gallery name
    $galleryname = basename($galleryfolder);

    // check for existing galleryfolder
    $gallery_id = $wpdb->get_var(“SELECT gid FROM $wpdb->nggallery WHERE path = ‘$galleryfolder’ “);

    if (!$gallery_id) {
    $result = $wpdb->query(“INSERT INTO $wpdb->nggallery (name, path) VALUES (‘$galleryname’, ‘$galleryfolder’) “);
    if (!$result) {
    nggallery::show_error(__(‘Database error. Could not add gallery!’,’nggallery’));
    return;
    }
    $created_msg =__(‘Gallery’,’nggallery’).’ ‘.$galleryname.’ ‘.__(‘successfully created!’,’nggallery’).”;
    $gallery_id = $wpdb->insert_id; // get index_id
    }

    // Look for existing image list
    $old_imageslist = $wpdb->get_col(“SELECT filename FROM $wpdb->nggpictures WHERE galleryid = ‘$gallery_id’ “);
    // if no images are there, create empty array
    if ($old_imageslist == NULL) $old_imageslist = array();
    // check difference
    $new_images = array_diff($new_imageslist, $old_imageslist);
    // now create thumbnails

    //nggAdmin::generateThumbnail($gallerypath,$new_images);
    //Instead of creating the thumbs, we are just going to check if all images have a thumnb in the thumbs directory. Only images with thumb will be included
    $new_thumbslist = nggAdmin::scandir($gallerypath.”/thumbs”);
    $new_images = array_intersect($new_images, $new_thumbslist);
    //and after compration we need to “create the thumbs files”
    foreach($new_images as $thumb) {
    //echo “$thumb/n/r”;
    rename ( $gallerypath.”/thumbs/”.$thumb, $gallerypath.”/thumbs/thumbs_”.$thumb);
    }

    // add images to database
    $count_pic = nggAdmin::add_Images($gallery_id, $gallerypath, $new_images);

    nggallery::show_message($created_msg.$count_pic.__(‘ picture(s) successfully added’,’nggallery’));
    return;

    }

    It makes exactly the same as importgallery but without lunching the creation of thumbs. Instead it checks if there is a thumb already created for each picture you want to import.
    b. In the manage.php file (nextgen-gallery/admin/wp25/) you need to add this lines.
    Right after the “if (isset ($_POST[‘scanfolder’]))”, in a new if:

    if (isset ($_POST[‘scanfolder1and1’])) {
    // scan folder looking for th files and the thumbs…a void producing the thumbs
    check_admin_referer(‘ngg_updategallery’);

    $gallerypath = $wpdb->get_var(“SELECT path FROM $wpdb->nggallery WHERE gid = ‘$act_gid’ “);
    nggAdmin::import_gallery1and1($gallerypath);
    }

    And a new button to launch the process. After the “Scan Folder for new images”:

    <input type=”submit” name=”scanfolder” value=” ” />
    <input type=”submit” name=”scanfolder1and1″ value=” ” />

    2- Now, basically, we have to upload both pictures and thumbs (in a thumbs folder). Both files must have the same name (pay attention to the extension).
    3- You have to create the gallery without uploading any image.
    4- Then in “manage” the gallery next to the “Scan Folder for new images” button you will see a “Scan Folder for new images and thumbs” that launches the process.
    Note that this is just a patch… I am pretty sure there is a better way of coding this solution (I am not a web developer)…and sure it should be easy to make points 3 and 4 run one after the other by creating a new “Import pictures and thumbs from a folder” in the “new gallery” section.
    I am sharing this dummy solution just in case Alex wants to include some patch for 1nd1 users….

  8. Randy says:

    Manolo,

    I think you have a great fix for a very frustrating problem.

    But..

    I wasn’t sure which version of the plugin you are using, I upgraded to 0.99.1 trying to fix this. I would be glad to roll back though.

    And Alexes CSS is messing up the code. and copy and paste to dreamweaver isn’t working.

    Maybe you can contact me —- spam at grammalei.com —and we can exchange email addresses ??

    If not I will try and go through the code and figure out all the mistakes in the copy process.

Comments are closed.

%d bloggers like this: