We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23050
    • 1,842 Posts
    Hello,

    I'm running MODx Evo 1.0.12 on PHP 5.3.28 (also tried on 5.5.7) and thumbnails don't want to create in assets/cache/images

    I tried to CHMOD assets/cache/images 755 and 777.

    I guess snippet may work well as
    [[phpthumb? &input=`[+vignette+]` &options=`w=200,h=200,zc=1`]]
    calls assets/cache/images/200x200-yeux_bleu.785.jpg but the thumbnails is not created in assets/cache/images.
    When I try to view the image in Firefox, I get a 403 error.

    In phpThumb.config.php, I have :
    $PHPTHUMB_CONFIG['cache_directory'] = dirname(__FILE__).'/../../cache/images/';  

    Is that right ?

    Where else can I search for a potentiel error ?

    Thank you !
    • Could be an .htaccess problem that denies the access in assets/cache.

      Add .htaccess in assets/cache/images with the content

      order deny,allow
      allow from all
      

        • 23050
        • 1,842 Posts
        403 error is now gone ! smiley
        But I get a 404 error as the image is not created in the folder assets/cache/images :/

        Why is this image not created ??!
        • The folder assets/cache/images has 777 now? Maybe the image is not valid for phpthumb snippet.
            • 23050
            • 1,842 Posts
            Yes, I've tried both 777 and 755 and nothing works.

            I tried to use MODx logo.png in assets/images whith no chance

            I tried to change directory assets/cache/images to assets/images or assets/.thumbs (as I know there are good CHMOD on it because FCKEditor can write) but nothing too.

            There are no message in error log

            Maybe a configuration of my server ? I host on shared server, at Strato.
              • 23050
              • 1,842 Posts
              Do you know if FCKEditor and phpthumb use the same functions to generate thumbnails ? FCKEditor can create thumbnails in assets/.thumbs in the file browser.
              So, why phpthumb can't ?
                • 34029
                • 3 Posts
                Same problem here with strato.de :/

                ----

                Edit:

                After some searches i found a Error-Track here:
                http://tracker.modx.com/issues/54

                Looks like someone else had the same Problem on phpThumb for REVO on a strato-Server.
                The document_root variable gets false path.informations! If you want to fix the problem:

                1. create Snippet which outputs the absolute path:
                <?php
                echo $_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'];
                ?>


                Get the output of this snippet, its the file path you need for configuring phpthumb.


                2. Edit the phpThumb-Config File:
                assets/snippets/phpthumb/phpThumb.config.php

                Edit and comment out the following line:
                $PHPTHUMB_CONFIG['document_root'] = realpath((@$_SERVER['DOCUMENT_ROOT'] && file_exists(@$_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'])) ? $_SERVER['DOCUMENT_ROOT'] : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', realpath('.'))));

                to:
                //$PHPTHUMB_CONFIG['document_root'] = realpath((@$_SERVER['DOCUMENT_ROOT'] && file_exists(@$_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'])) ? $_SERVER['DOCUMENT_ROOT'] : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', realpath('.'))));


                then add the following line and add the path you get from the snippet under 1.
                $PHPTHUMB_CONFIG['document_root'] = 'YOUR-PATH-HERE';


                Your path will end with 'htdocs' - If your modx-installation is in a SUB.Directory, add the subdirectory on the end of the path as the snippet from 1. dont displays the subdirectory-path!

                Looks like strato got some very weird document-path config.hack on their shared hostings! Get your customers onto your servers! laugh
                Good luck! [ed. note: urbandigital last edited this post 9 years, 8 months ago.]