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

    I have s strange issue with either phpthumbof or core phpthumb. I do have relative path setting like that:
    assets/files/
    yes
    assets/files/
    yes

    Modx 2.1.2

    My web site has many pictures and sometimes, don’t know when actually and why having this problem.

    Problem desctiption:
    First: Constantly appearing files (like pThumbBkBWJC, pThumbIfRgT2 in document root folder of the hosting - public_html in my case).
    Second: Error log lines, like:

    [2011-08-12 12:05:25] (ERROR @ /home/o/obstanru/public_html/core/model/phpthumb/phpthumb.class.php : 1312) PHP warning: getimagesize(/home/o/obstanru/public_html//product/nedokach/bazh-orion-6.jpg) [<a href=’function.getimagesize’>function.getimagesize</a>]: failed to open stream: No such file or directory
    [2011-08-12 12:05:25] (ERROR @ /home/o/obstanru/public_html/core/model/phpthumb/phpthumb.class.php : 1312) PHP warning: getimagesize(/home/o/obstanru/public_html//product/nedokach/bazh-orion-6.jpg) [<a href=’function.getimagesize’>function.getimagesize</a>]: failed to open stream: No such file or directory
    [2011-08-12 12:05:25] (ERROR @ /home/o/obstanru/public_html/core/model/phpthumb/phpthumb.class.php : 3210) PHP warning: file_get_contents(/home/o/obstanru/public_html//product/nedokach/bazh-orion-6.jpg) [<a href=’function.file-get-contents’>function.file-get-contents</a>]: failed to open stream: No such file or directory
    [2011-08-12 12:05:25] (ERROR @ /index.php) [phpThumbOf] Could not generate thumbnail: /product/nedokach/bazh-orion-6.jpg - Debug: Array
    (
    [0] => phpThumb() v1.7.9-200712090829 in file "phpthumb.class.php" on line 216
    [1] => setCacheDirectory() starting with config_cache_directory = "/home/o/obstanru/public_html/core/cache/phpthumb/" in file "phpthumb.class.php" on line 919
    [2] => setting config_cache_directory to realpath(/home/o/obstanru/public_html/core/cache/phpthumb) = "/home/o/obstanru/public_html/core/cache/phpthumb" in file "phpthumb.class.php" on line 947
    [3] => setCacheDirectory() starting with config_cache_directory = "/home/o/obstanru/public_html/assets/components/phpthumbof/cache/" in file "phpthumb.class.php" on line 919
    [4] => setting config_cache_directory to realpath(/home/o/obstanru/public_html/assets/components/phpthumbof/cache) = "/home/o/obstanru/public_html/assets/components/phpthumbof/cache" in file "phpthumb.class.php" on line 947
    [5] => setSourceFilename(/product/nedokach/bazh-orion-6.jpg) set $this->sourceFilename to "/product/nedokach/bazh-orion-6.jpg" in file "phpthumb.class.php" on line 243
    [6] => skipping CleanUpCacheDirectory() set to purge (0.0 days; 0.00MB; 0 files) in file "phpthumb.class.php" on line 652
    [7] => skipping CleanUpCacheDirectory() because config set to not use it in file "phpthumb.class.php" on line 751
    [8] => CleanUpCacheDirectory() purged 0 files (from 0) based on config settings in file "phpthumb.class.php" on line 757
    [9] => $AvailableImageOutputFormats = array(text;ico;bmp;wbmp;gif;png;jpeg) in file "phpthumb.class.php" on line 884
    [10] => $this->thumbnailFormat set to $this->config_output_format "jpeg" in file "phpthumb.class.php" on line 895
    [11] => $this->thumbnailFormat set to $this->f "jpeg" in file "phpthumb.class.php" on line 902
    [12] => $this->thumbnailQuality set to "75" in file "phpthumb.class.php" on line 912
    [13] => ResolveFilenameToAbsolute() prepending $this->config_document_root (/home/o/obstanru/public_html/) to $filename (/product/nedokach/bazh-orion-6.jpg) resulting in ($AbsoluteFilename = "/home/o/obstanru/public_html//product/nedokach/bazh-orion-6.jpg") in file "phpthumb.class.php" on line 1025
    [14] => $this->sourceFilename set to "/home/o/obstanru/public_html//product/nedokach/bazh-orion-6.jpg" in file "phpthumb.class.php" on line 813
    [15] => phpThumb() v1.7.9-200712090829

    as you might see the problem is regarding relative url, because by looking at $this->sourceFilename set to "/home/o/obstanru/public_html//product you can see double slash, where actually should relative path be.

    Any ideas?
      • 20912
      • 21 Posts
      no one has a solution?
        • 1343 ☆ A M B ☆
        • 2,213 Posts
        Can you tell us more about your hosting environment?
          Patrick | Server Wrangler
          About Me: Website | Tweets |  MODX Hosting
          • 20912
          • 21 Posts
          Quote from: AMDbuilder at Aug 14, 2011, 10:42 PM

          Can you tell us more about your hosting environment?

          What do u want to know actually?
            • 1343 ☆ A M B ☆
            • 2,213 Posts
              Patrick | Server Wrangler
              About Me: Website | Tweets |  MODX Hosting
              • 20912
              • 21 Posts
              Dont know why but i accidentaly created new thread

              MODX Revolution 2.1.2-pl
              mysql 5.1.50-lk-log utf8

              Phpinfo in attachment.

              Plugins: directresize, migx, phpthumbof, tinymce, autofiximagesize
                • 1343 ☆ A M B ☆
                • 2,213 Posts
                It looks like everything is setup correctly, both GD and Imagemagic are installed, so there shouldn’t be any problems.

                Could you please provide us with the remaining information?

                How PHP is running (suexec, mod_php, CGI, etc.)
                Apache or IIS version
                Operating System and version

                MODx:
                Any changes you’ve made
                Any snippets you’re running on the page that is not working properly
                Any plugins you’re running

                The issue may still be with the server configuration (perhaps permission issue), or a MODX setting (wrong path perhaps).
                  Patrick | Server Wrangler
                  About Me: Website | Tweets |  MODX Hosting
                  • 20912
                  • 21 Posts
                  I have found the issue. Because I have so many pages with hundreeds images that was not so easy. Actually the hole problem was regarding the SLASH. In some fields manager edded wrong image link with extra slash therefore after saving path was like assets/files//products
                  that was not program fall - that was human’s
                  Have to change image validation script after...

                  Thank u everybody!
                    • 1343 ☆ A M B ☆
                    • 2,213 Posts
                    Glad to hear you got it working. Thanks for sharing the solution!
                      Patrick | Server Wrangler
                      About Me: Website | Tweets |  MODX Hosting