We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5399
    • 17 Posts
    Yes I have an assets/galleries folder with properties of 0777. I am not sure about CHMOD but I changed this by rightclicking on the folder.
    There are no folders inside this folder.
      • 7923
      • 4,213 Posts
      What php version you have? There has been some bugs with mkdir when directory path contains trailing slash.. http://bugs.php.net/bug.php?id=42739


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 5399
        • 17 Posts
        The hosting package says PHP5.

        There is a tick box in the hosting setup for PHP ’safe_mode’ on where I can unclick the box. Should I unclick this and therefore take safe_mode off?

        The site is live so this would not affect anything else would it as I would not want any problems..?
          • 7923
          • 4,213 Posts
          Could you try this first:

          Open up /assets/snippets/maxigallery/maxigallery.php file and replace the line 313:

          if(!mkdir($mg->path_to_gal, 0777)) {


          with:

          if(!mkdir(substr($mg->path_to_gal, 0, -1), 0777)) {


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 5399
            • 17 Posts
            Changed line 313.

            I now get the following error:

            « MODx Parse Error »
            MODx encountered the following error while attempting to parse the requested resource:
            « PHP Parse Error »

            PHP error debug
            Error: move_uploaded_file() [function.move-uploaded-file]: SAFE MODE Restriction in effect. The script whose uid is 10165 is not allowed to access /var/www/vhosts/christinescottinteriors.co.uk/httpdocs/assets/galleries/64 owned by uid 48
            Error type/ Nr.: Warning - 2
            File: /var/www/vhosts/christinescottinteriors.co.uk/httpdocs/assets/snippets/maxigallery/maxigallery.php
            Line: 371
            Line 371 source: move_uploaded_file( $_FILES[’file’.$i][’tmp_name’] , $mg->path_to_gal.$name );

            Parser timing
            MySQL: 0.0888 s (5 Requests)
            PHP: 0.0544 s
            Total: 0.1432 s
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              safe_mode won’t let a process running as one user access anything owned by another user, so the maxigallery script (running as the apache user) can’t open the folder owned by your ftp user.

              http://il2.php.net/features.safe-mode
                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
                • 7923
                • 4,213 Posts
                Then you need to configure MaxiGallery to use ftp commands to upload picture,

                Add the following parameters to your maxigallery call that is used to upload pictures (eg. in the manage document id 63):

                &use_ftp_commands
                &ftp_base_dir
                &ftp_pass
                &ftp_port
                &ftp_server
                &ftp_user

                See their usage from MaxiGallery wiki page.

                You can also remove the previous modification from maxigallery.php.


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 5399
                  • 17 Posts
                  I tried the settings but all that seemed to happen when I clicked on manage pictures on the next page it showed the ftp server and nothing else.

                  I have now unticked the box for safe mode and can now upload photos smiley

                  I am now having issues whereby I can not get the thumbnail resize to work.

                  [!MaxiGallery? &galleryPictureTpl=`mgGalleryPicture` &js=`mgJs` &max_thumb_size=`50x50` &manage_target=`63` !] I have tried uploading new images after changing the settings but this does not seem to work either.

                  Any advice?

                  Claire
                    • 7923
                    • 4,213 Posts
                    Quote from: clairecastle at Apr 02, 2008, 10:05 AM

                    I tried the settings but all that seemed to happen when I clicked on manage pictures on the next page it showed the ftp server and nothing else.
                    Hmm.. I don’t know how that would be even possible.. but.. are you sure you used a call like this in the document with id 63:

                    [!MaxiGallery? &is_target=`1` &use_ftp_commands=`1` &ftp_base_dir=`/public_html/modx/` &ftp_user=`username` &ftp_pass=`password` &ftp_port=`21` &ftp_server=`ftp.yoursite.com`!]

                    And replaced the values of ftp_base_dir, ftp_user, ftp_pass, ftp_port and ftp_server with your own details?

                    Quote from: clairecastle at Apr 02, 2008, 10:05 AM

                    I have now unticked the box for safe mode and can now upload photos smiley
                    Not sure if that is such a good move..

                    Quote from: clairecastle at Apr 02, 2008, 10:05 AM

                    I am now having issues whereby I can not get the thumbnail resize to work.

                    [!MaxiGallery? &galleryPictureTpl=`mgGalleryPicture` &js=`mgJs` &max_thumb_size=`50x50` &manage_target=`63` !] I have tried uploading new images after changing the settings but this does not seem to work either.

                    Any advice?

                    Claire
                    Like I have previously said, the parameters that affect to the images needs to be on the picture management document, eg. move that &max_thumb_size parameter to the call that is in the document with id 63.


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 5399
                      • 17 Posts
                      Quote from: doze at Apr 02, 2008, 10:31 AM

                      Quote from: clairecastle at Apr 02, 2008, 10:05 AM

                      I tried the settings but all that seemed to happen when I clicked on manage pictures on the next page it showed the ftp server and nothing else.
                      Hmm.. I don’t know how that would be even possible.. but.. are you sure you used a call like this in the document with id 63:

                      [!MaxiGallery? &is_target=`1` &use_ftp_commands=`1` &ftp_base_dir=`/public_html/modx/` &ftp_user=`username` &ftp_pass=`password` &ftp_port=`21` &ftp_server=`ftp.yoursite.com`!]

                      And replaced the values of ftp_base_dir, ftp_user, ftp_pass, ftp_port and ftp_server with your own details?

                      Yes I am sure. I had:
                      [!MaxiGallery? &is_target=`1` &use_ftp_commands=`1` &ftp_base_dir=`/httpdocs/` &ftp_pass=`my password` &ftp_port=`21` &ftp_server=`ftp.fuzetesting.co.uk` &ftp_user=`christinescott`!]

                      Quote from: clairecastle at Apr 02, 2008, 10:05 AM

                      I have now unticked the box for safe mode and can now upload photos smiley
                      Not sure if that is such a good move..

                      Why?

                      Quote from: clairecastle at Apr 02, 2008, 10:05 AM

                      I am now having issues whereby I can not get the thumbnail resize to work.

                      [!MaxiGallery? &galleryPictureTpl=`mgGalleryPicture` &js=`mgJs` &max_thumb_size=`50x50` &manage_target=`63` !] I have tried uploading new images after changing the settings but this does not seem to work either.

                      Any advice?

                      Claire
                      Like I have previously said, the parameters that affect to the images needs to be on the picture management document, eg. move that &max_thumb_size parameter to the call that is in the document with id 63.

                      Yes sorry - very new to this