We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8471
    • 333 Posts
    Hi, I have tried to upload a zip file (with photos inside laugh) but I received this parse error
    I’m using MaxiGallery v0.5 BETA2 Rev49 on MODx 0.9.2.2, and I think I have zlib installed:
    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource: 
    « PHP Parse Error » 
      
    PHP error debug 
      Error:  chmod() [function.chmod]: No such file or directory   
      Error type/ Nr.:  Warning - 2   
      File:  C:\sito\assets\snippets\maxigallery\maxigallery.php   
      Line:  255   
      Line 255 source:  chmod($path_to_gal.$name,0666);    
      
    Parser timing 
      MySQL:  0.2017 s s (40 Requests) 
      PHP:  0.9720 s s   
      Total:  1.1737 s s   

    Any ideas?
      Sorry for my bad English grin
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Yes, you have zlib installed. Did you create a folder called "galleries" in the assets folder, and make it writable?
        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
        • 8471
        • 333 Posts
        Yes I did
        Thanks for your help
          Sorry for my bad English grin
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Oh... wait a minute, we’re talking a Windows server here. I don’t think chmod works on a Windows server... huh
            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
            There might be (many) bugs in the zip upload code as I haven’t tested it at all, just wrote it up smiley ..but the line number that your error message show is before the zip related code, so it’s not that.. The code that the error comes with is:

            Line: 254. This should move the uploaded file to the assets/galleries/docid/ folder, eg. assets/galleries/docid/something.zip
            move_uploaded_file( $_FILES[’file’.$i][’tmp_name’] , $path_to_gal.$name );

            Line: 255. This should then chmod the file. But it seems that the zip was never moved there by move_uploaded_file. Don’t know what’s that about.
            chmod($path_to_gal.$name,0666);

            Its not the chmod that is failing, it works fine even on windows, it’s the move_uploaded_file that’s not working.

            Unfortunately, I’m just leaving for a work trip for the rest of the year and won’t be able to develop this as much as I’d like. I hope I get laptop soon what I can use in the mean time.. But there might be some lag in my responses for a while.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 8471
              • 333 Posts
              don’t worry doze wink
              Have a nice trip and thanks again to all for your help
                Sorry for my bad English grin
                • 5594
                • 4 Posts
                Hi,

                I just got started with Modx and I am having the same problem as the above poster. I was able to solve it a little bit, by changing the code

                What I had :
                PHP Fatal error: Call to undefined function handlePics() in /var/www/html/assets/snippets/maxigallery/maxigallery.php on line 296,PHP Fatal error: Call to undefined function handlePics() in /var/www/html/assets/snippets/maxigallery/maxigallery.php on line 296

                I changed the line from:
                handlePics($pics_tbl, $path_to_gal, $pageinfo[’id’], $jpgfilename, "jpeg");
                $mg->handlePics($pics_tbl, $path_to_gal, $pageinfo[’id’], $jpgfilename, "jpeg");

                as well as the PNG line for the same call , as I had noticed the handlePics function is called the same way throughout... So this worked until

                Call to undefined function ImageCreateFromJPEG() in /var/www/html/assets/snippets/maxigallery/watermark/Thumbnail.class.php on line 183

                My best guess is that this is one of two things - either my php does not have jpeg capabilities, this is udpated fedora core 5 system, maybe?
                Or that SELinux is doing something nasty behind the scenes, I will disable SELinux and try it, but maybe you already know?

                I just checked phpinfo and it is compiled --with-jpeg... so selinux next.


                I installed the earlier version of Maxigallery and the handlepics problem wasn’t there but the ImageCreateFromJPEG did throw an error.

                For information, the directory is getting created, and one image is extracted, then nothing happens, no manipulation, it dies.

                I’ve upped my post size, memory size, and all that stuff pretty high as one of the zip files was 100 megs, but I also dropped it down to a smaller zip file to test it and still had no luck.

                Any info is appreciated.

                thanks
                john
                  • 7923
                  • 4,213 Posts
                  @codezero
                  It seems that you still dont have the image support in your php installation.. I use xampp in my linux box and it works fine with default settings, could you use that?


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 5594
                    • 4 Posts
                    No, I don’t think it would be wise for me to change the setup, it’s actually a server at work, but I will look into getting the proper image support, do you know what is required?

                    I thought it was just --with-jpeg that enabled the support, but maybe there is something else I need.

                    - looks like default php is compiled --without-gd and I think that will do it.. i’ll look into fixing this, however, should I revert to a fresh .5 beta install, regarding the changes made in the php for the handlePics?

                    regard,
                    john

                    ps. left it as is, installed php-gd and it works now it looks like - thanks.

                    john
                      • 7923
                      • 4,213 Posts
                      Yes, use 0.5 beta, but include your fix to the handlePics calls in the zip processing code if you are uploading zips.. I had left it out by mistake because I haven’t used zips my self. BTW, do you have the necessary ZZIPlib installed in your php setup? Could you report that does the zip uploads work or not?


                        "He can have a lollipop any time he wants to. That's what it means to be a programmer."