Hi having a mad problem uploading images via the manager .. i can create folders etc .. but images just times out .. an emergenct .. going live ssosn ! any idea?
Everytime you use Flash ... a puppy dies .....
R.G Taylor
-
☆ A M B ☆
- 24,524 Posts
How big are the images you are trying to upload? Have you optimized them for web use?
Yes susan .. it wont accept anything ! even tiny 5 k thumbs .. it just sits on upload.
Everytime you use Flash ... a puppy dies .....
R.G Taylor
any error message? Did you check the file permissions on the created folders?
-
MODX Staff
- 12,272 Posts
I’m 99% certain the permissions on the folders created by the file managers won’t allow you to upload any files.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
ive set all folders to 777 ... same problem.....
i can upload to root .. even tho i can create folders?
Everytime you use Flash ... a puppy dies .....
R.G Taylor
The problem is likely due to the way PHP is configured (suExec for example). Many times, Apache will run as a different user than the one who has ownership over the site files. This really complicates things since it means that PHP will attempt to upload files and/or create directories that conflict with the real permissions of the directory PHP is operating on. If Apache and PHP are setup to use suExec or some other method of running PHP as CGI then there should be a way to tell it to run under the ownership of the same user that owns the site files. If not then you’ll still continue to have the same problem.
Jeff Whitfield
"I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
-
☆ A M B ☆
- 24,524 Posts
That’s what suexec does. It switches the user from the Apache user to the owner of the script being run.
My directories are owned by "me". When I log in via ftp, I log in as "me", so I have full access to all of my directories, and anything I upload is owned by "me".
When you use a script to upload a file, normally this script is run as part of the Apache user, this may be "apache" or "www" or even "nobody". Thus the file getting uploaded is owned by that user, say "apache". Unless that file is stored with world-readable/writable/executable (777) permissions, the "me" user won’t be able to do anything with this file owned by "apache". For example, if you use a script to upload images, you have to use another script to move or delete these images, you can’t do it from an ftp login.
On the other hand, if the PHP is run separately from the web server and suexec is used, when Apache calls the php to run, it will run as the owner of the .php file being run. So all files created or uploaded by the script, which is owned by "me", will also be owned by "me" since the script has switched user to run as "me". Now I can access these files via ftp. I also don’t need to have any directories world-writable, since they are owned by "me" and the script is running as "me" it can write to them with no problem.