We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25839
    • 23 Posts
    https://forums.modx.com/thread/75659/phpthumb-browser-preview-no-thumbnail-recurrent-topic

    actually there is solution, but only if you have access to php.ini
      • 37746
      • 42 Posts
      That is interesting, thank you. Perhaps I'll go and check with the hosting company to alter php.ini file. Unless there is any other solution at all?
        • 25839
        • 23 Posts
        Quote from: okyanet at May 07, 2012, 05:19 AM
        If you put the following into your browser do you get any image?

        http://www.domain.co.uk/connectors/system/phpthumb.php?h=150&w=150&src=images/properties/pinkers-mead-emersons-green/50_5.jpg


        I was doing it and yesteday noticed something really strange

        when I put this link (with my domain of course) into adress bar - it causes Internal Server Error, both manager and website are going down for several minutes.

        After apache kills crashed process (probably, I'm not sure what is exactly happening) - the very same link gives me 404 error and redirects to 404 page defined in manager

        after third refresh - it shows thumbnail

        strange, huh?

        thumbnails are of course created after first launch (they appear in phpthumb's cache)
          • 33968
          • 863 Posts
          That's very odd, you're getting an 'unauthorised' response. Not sure why it's coming back as JSON either. Is the phpthumb cache folder writable?

          If you're ok with php, the place to look is core/model/phpthumb/modphpthumb.class.php. That's where the config options are passed from MODX to the phpthumb class. You might want to try setting some error logging within the different functions of that class to see how far it gets before returning the error. That may help you to narrow it down to where the problem is occurring.
            • 25839
            • 23 Posts
            i have seen several advices and examples of changed phpthumb.class, and tried them without success (also, everyone is suggesting something else as cure grin ), which means they probably work for some people but are not real fixes (in most cases people suggest adding hardcoded path to assets at some point in code)

            but since I noticed behaviour described above (thumbnail shows after several tries) I am not sure if it really is path issue
              • 25839
              • 23 Posts
              update

              I just set up fresh installation and reproduced error again

              thumbnails in browser and imageTV thumbnails were working to the moment when I changed Media Source paths from default empty to /assets/img/

              reverting back to empty values does not fix it

                • 33968
                • 863 Posts
                @rygar - when you change media source paths, does it change the path in the 'src' parameter below?

                http://www.domain.co.uk/connectors/system/phpthumb.php?h=150&w=150&src=images/properties/pinkers-mead-emersons-green/50_5.jpg
                  • 25839
                  • 23 Posts
                  yes, it does

                  also, changing URL path changes what is shown in imageTV field in resource

                  strage thing is that reverting to previous state does not fix things.

                  if I inject something into URL to check if path is wrong, it immediatelly throws error (for example, if I artificially add /assets/img/ into path, error log show that phpthumb could not fint assets/img/assets/img/file.jpg, so it already had right path stored)
                    • 25839
                    • 23 Posts
                    yet another error-trigger

                    thumbnails are stopping to show themselves as soon as new context is being created

                    when I remove new context (system / contexts) and leave only web and manager - thumbnails are working again


                      • 25839
                      • 23 Posts
                      it seems I probably found solution for those errors

                      solution is simple - add more RAM grin

                      If you are using MODX with thumbnails / image TVs, 75 MB is not enough!

                      i have copied my website to two different providers, both with 150 and 200 MB memory limits, and there were no problems! On one case, memory limit was the only difference, php version and mysql versions were the same