-
- 21 Posts
Hope I’m not covering old ground with this one but I’ve tried everything!
Everytime I upload a file to a maxigallery folder, the snippet code tries to chmod the thumbnail file but i get an error where it cant find the file...
***************************************************************************************
Error: chmod() [function.chmod]: No such file or directory
Error type/ Nr.: Warning - 2
File: /home/xxxxxxx/public_html/assets/snippets/maxigallery/maxigallery.php
Line: 374
Line 374 source: chmod($mg->path_to_gal.$name,0666);
***************************************************************************************
I’ve looked at just about every setting in Maxigallery but nothing works.
Any help greatly appreciated!
David
www.webcomsystems.biz
-
- 13 Posts
Hello,
I’m also becoming crazy with this permission problem... Ive been reading the other posts and tried to use the ftp commands for example. Changing persmissions in cuteftp and so on..
In cute ftp i can see that folders created by maxigallery and manually created folders have different owners. is it somewhere here where the problem lies???
Im also having problems with resynching a gallery after adding some images manually through ftp...
I am to rookie to be able to upgrade to this other version that you guys are talking about. Though, already using the latest official release.
I hope it is time for a new release or that someone can write some kind of help document to this issue that actually seems to be quite common...
i’d be more than thankful for any answer.,..
//johan
Upload 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: /home/d2152/xxxx/assets/snippets/maxigallery/maxigallery.php
Line: 372
Line 372 source: chmod($mg->path_to_gal.$name,0666);
Parser timing
MySQL: 0.0072 s (5 Requests)
PHP: 0.7892 s
Total: 0.7963 s
Resynch gallery problem:
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error: imagejpeg() [function.imagejpeg]: Unable to open ’assets/galleries/54/1100002.jpg’ for writing
Error type/ Nr.: Warning - 2
File: /home/d2152/xxxxxx/assets/snippets/maxigallery/watermark/Thumbnail.class.php
Line: 331
Line 331 source: imageJPEG($this->img["des"],"$save",$this->quality);
Parser timing
MySQL: 0.0042 s (3 Requests)
PHP: 0.4765 s
Total: 0.4808 s
When you upload something via ftp, it is owned by your ftp user. When a php script uploads something, it is owned by whatever user your php scripts run as, usually the Apache user (www, nobody, apache...depends on the Apache configuration). Now you are limited in what you can do with these items via ftp, but another php script can work with them.
That is why I always insist on hosting with PHP run with some sort of suexec. The script is run as the owner of the script, and since you uploaded the script with your ftp (or ssh) client it is owned by you. This way you don’t need 777 (anybody can read and write) permissions on anything (such as the assets/cache folder and it files), and whatever you upload can be worked with by your php scripts, and whatever gets uploaded by a php script is owned by you as well.
It not only saves a lot of aggravation, it’s more secure as well.
-
- 21 Posts
so is this a bug in Maxigallery?
do we need to run SUEXEC for it work at all?
-
- 4,213 Posts
I don’t know what the problem is with your environments.. I have seen this same issue come up couple times and I’d like to get it resolved in code if it’s possible, but it doesn’t happen with any of my environments and it’s something server specific..
There are couple things you can try.. If you are already running suexec environment, file permissions can’t go over 644 and folder permissions over 755. MaxiGallery chmods files to 666 and folders to 777, so that causes problems if you are using suexec. So ask your host if you are using it and in that case search replace maxigallery code 666 -> 644 and 777 -> 755.
If that alone doesn’t solve it, then try this together with the above modifications:
http://modxcms.com/forums/index.php/topic,17031.msg115073.html#msg115073
I have prepared the next release to work better with suexec environments without the need of file modifications, but it’s not done yet and it’s unfortunately been hard to find time to do any maxigallery related coding lately..
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
- 13 Posts
ok i will try changing the numbers in the files.
btw, my host said that they dont use suexec, but using "php as a module on a apache server"...
In that case the images uploaded by MaxiGallery will belong to the Apache user, whatever that may be.
-
- 21 Posts
Thanks for the responses.
So is there a quick fix we can apply in the mean time?
I’m kind of desperate to get this running properly.
Thanks
-
- 4,213 Posts
No magic wand solutions that I know of.. If get your environment fixed, let me know what you did and I’ll get the code fixed if necessary.. Thanks.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."