We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33982 ☆ A M B ☆
    • 476 Posts
    I have a site in a sub directory during development were I'm using phpThumbOf (vs 1.3.2) on MODx 2.2.4-pl. Basically I have Media Sources pointing to a specific directory so the client will upload their images in a very specific place when they upload their image via a TV. In the output in the HTML when I call the TV, I get the following error:

     <b>Warning</b>:  file_get_contents(/home/xxxxxxx/public_html/development//development/assets/client_files/images/home/video_thumbs/vid-1.jpg) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in <b>/home/xxxxxxx/public_html/development/core/model/phpthumb/phpthumb.class.php</b> on line <b>3210</b>
     


    Here's the TV output with phpThumbOf:

    <img src="[[*home_column1_video_thumb:phpthumbof=`w=120&h=120`]]">


    The subdirectory is named "development". As you can see from the above error, "development" shows up twice. [ed. note: flinx777 last edited this post 14 years, 3 months ago.]
      Precision Web Development ... SmashStack.com
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      The problem is somehow due to how you've configured MODX to run in a subdirectory.

      From your config file:

       $modx_base_url= '/development/';
       // ...
       $modx_assets_url= '/development/assets/';
      


      I'm not sure what exactly needs to be changed...

      Note that the Media Source has the following defined:

      basePath: assets/client_files/images/
      baseUrl: assets/client_files/images/


      The raw TV tag gets parsed as something like /development/assets/client_files/images/myimg.jpg

      Something ain't right there, but I can't put my finger on it. [ed. note: Everettg_99 last edited this post 14 years, 4 months ago.]
        • 33982 ☆ A M B ☆
        • 476 Posts
        Arrgh. So frustrating. Got a big demo tomorrow and can't pin this down sad
          Precision Web Development ... SmashStack.com
          • 3749
          • 24,544 Posts
          I would try setting base_url in core/config/config.inc.php to '/' and if you get a double slash at the begininng of the path, set it to ''

          Unless you're on localhost, you usually don't need the subdirectory name in the base url.



          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 33982 ☆ A M B ☆
            • 476 Posts
            Got it. You set me on the right path on this one and I was able to fix it. Here's what I did in case this saves someone some grief down the road:

            Per Bob's suggestion, I set the base_url in the config file to just '' (no '/' or '/development/' in it anymore). Once I pulled this out, PHPThumbOf started working again correctly.

            Also good to know about the advice regarding localhost vs server. I'm on the server and I'm used to developing on localhost and then pushing to the server, but this time I was just on the server.

            Thanks Bob...as always, I owe you one!
              Precision Web Development ... SmashStack.com
              • 3749
              • 24,544 Posts
              Glad you got it sorted. Thanks for reporting back. smiley



              ------------------------------------------------------------------------------------------
              PLEASE, PLEASE specify the version of MODX you are using.
              MODX info for everyone: http://bobsguides.com/modx.html
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 33982 ☆ A M B ☆
                • 476 Posts
                Bleh...just logged into MODx this morning and the Manager was broken due to the config changes made. I'm gonna poke around on this more today and hunt down the problem. But definitely on the right path.
                  Precision Web Development ... SmashStack.com
                  • 33982 ☆ A M B ☆
                  • 476 Posts
                  Still can't seem to figure this out. T.V.'s, Media Sources, sub-directory and PHPThumbOf don't seem to mix. When I change the file path in the base_url, the Manager falls apart. Not sure if anyone else has been able to figure this out.
                    Precision Web Development ... SmashStack.com
                    • 3749
                    • 24,544 Posts
                    I forgot to add: Don't thank me until you're sure it works. wink

                    I made a serious error in my advice. There shouldn't be any quotes in the RewriteBase line, so this might work for you:

                    RewriteBase /


                    If that gives you double slashes, make sure that magic_quotes_gpc is turned off.

                    I tried to get back here to post that to you, but couldn't find this thread in Forum search, Google Search, Show Recent Posts, or my Forum Profile (which only shows 10 posts). Sorry for the confusion.

                    I consider dealing with the interaction of the various paths to be a black art, especially with the addition of Media Sources.

                    One more tip -- make sure you have uncommented the .htaccess code that forces www -> non-www or non-www -> www (but not both). If a user comes in on one type of URL and a link uses the other, things can get very messed up.


                    ------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using.
                    MODX info for everyone: http://bobsguides.com/modx.html
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 36926
                      • 701 Posts
                      Quote from: flinx777 at Jun 27, 2012, 12:27 AM
                      Still can't seem to figure this out. T.V.'s, Media Sources, sub-directory and PHPThumbOf don't seem to mix. When I change the file path in the base_url, the Manager falls apart. Not sure if anyone else has been able to figure this out.

                      Hey flinx777,

                      Did you ever managed to solve this issue. Having the same issue.

                      Got a image TV that the path is fine, but as soon as I either use phpThumb or a media source the full path to my sub domain is getting added which is breaking it.

                      Thanks

                      B