We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34120
    • 236 Posts
    I’ve tried changing the path a few times but it doesn’t seem to have any effect on the error message.
      • 34120
      • 236 Posts
      This might be of help to someone, I solved my problem with this post http://modxcms.com/forums/index.php/topic,63994.msg363440.html#msg363440, running phpthumbof as a snippet.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Has anybody gotten a solution to this?

        It's showing up in a site I've cloned into a subdirectory. Nothing here fixed the problem. I upgraded to 2.2, completely deleted the phpthumbof extra and re-downloaded and installed it. Setting the phpthumb_document_root makes no difference, no matter what I set it to.

        PHP warning: file_get_contents(/Applications/MAMP/htdocs/hah2//hah2/assets/images/gear/flexfit-black.jpg) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory

        The Media Source works fine, the TV works fine, MIGx works fine, the unmodified images are displayed fine.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          For some reason, the file path being fed into phpthumb has the base_path (in this case /hah2/) prepended to the raw image path returned by the TV.

          Further investigation shows all image TVs getting the base_path prepended. [ed. note: sottwell last edited this post 14 years, 8 months ago.]
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 28000 ☆ A M B ☆
            • 397 Posts
            Anyone get a fix for this? I am dealing with the same thing on multiple MODX Revo 2.2 installations. I already posted:
            https://forums.modx.com/thread/31485/problems-with-phpthumbof?page=2#dis-post-415103
              Benjamin Davis: American web designer living in Munich, Germany and a MODX Ambassador. I am also co-founder of SEDA.digital, a MODX Agency.
              • 28000 ☆ A M B ☆
              • 397 Posts
              I was able to solve it in a temporary fashion so:
              [[!phpthumbof? &input=`../[[*newsImage]]` &options=`&w=564&h=300&zc=1`]]
                Benjamin Davis: American web designer living in Munich, Germany and a MODX Ambassador. I am also co-founder of SEDA.digital, a MODX Agency.
                • 28000 ☆ A M B ☆
                • 397 Posts
                Now that I installed Babel and am dealing with contexts, than this did not work anymore. The only way I found now to solve it is to leave the base_url setting empty..for some reason it works. But the tinymce now is not correctly inserting images from the media browser sad
                  Benjamin Davis: American web designer living in Munich, Germany and a MODX Ambassador. I am also co-founder of SEDA.digital, a MODX Agency.
                  • 29597 ☆ A M B ☆
                  • 350 Posts
                  I am still getting this problem!
                  Only on a site wich is in a subfolder...
                  Tried all the above fixes....

                  Anybody have a fix?

                  [2012-03-24 12:05:27] (ERROR @ /home/designfr/domains/designfromwithin.com/public_html/flexibility/demo/core/model/phpthumb/phpthumb.class.php : 3210) PHP warning: file_get_contents(/home/designfr/domains/designfromwithin.com/public_html/flexibility/demo/flexibility//assets/components/gallery/files/1/6.png) [function.file-get-contents]: failed to open stream: No such file or directory
                  [ed. note: ThaClown last edited this post 14 years, 6 months ago.]
                    MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
                    DESIGNfromWITHIN, MPThemes and Any Screen Size
                    Follow me on Twitter | Read my blog | My code on GitHub
                    • 20215
                    • 144 Posts
                    Same problem!


                    [14] => ResolveFilenameToAbsolute() prepending $this->config_document_root (/home/www/websites/domain.com/sito/) to $filename (/sito/assets/templates/bmx/images/articoli/spray-tecnici/vmd10.jpg) resulting in ($AbsoluteFilename = "/home/www/websites/domain.com/sito//sito/assets/templates/bmx/images/articoli/spray-tecnici/vmd10.jpg") in file "phpthumb.class.php" on line 1025


                    $AbsoluteFilename value, contains double subdir .../sito//sito/... instead of .../sito/...

                    $_SERVER['DOCUMENT_ROOT'] // return /home/www/websites/domain.com
                    but $this->config_document_root for some reason // return /home/www/websites/domain.com/sito/

                    for now I solved by changing the line 1024 of core/model/phpthumb/phpthumb.class.php to:
                    $AbsoluteFilename = $_SERVER['DOCUMENT_ROOT'].$filename;

                    [ed. note: mopmodx last edited this post 14 years, 6 months ago.]
                      ----------------------------------
                      canale irc Italiano #modx server: tophost.azzurra.org
                      • 18373 ☆ A M B ☆
                      • 3,141 Posts
                      Try setting phpthumb_document_root to /home/www/websites/domain.com/ and phpthumb_allow_src_above_docroot to yes.
                        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.