Topic: trouble with photo upload (Read 2059 times)
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« on: Apr 08, 2006, 12:44:52 am »
Hello,
I think I wrote a really good upload class and the class works fine on lots of servers.
On some servers I have problems with the chmod values. The script uploads a file to location creates a 1 or 2 resized versions and finally the orig. file. so far zo good. The script creates also not existing directories with a chmod value of 0755. the files getting a value of 0644.
On some servers I need to create the upload folder with a mode 0777 otherwise ther is no permission to upload. creating the folders is not possible and resized file (GD lib.) is getting a 0666. What happens here is there something wrong on the shared host? I thought that php scripts are executed as an owner?
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 5799
46391 credits Members referred : 3
« Reply #1 on: Apr 08, 2006, 11:16:30 am »
Well php is running as a process of httpd (apache)
So it will use the permissions of the apache user (on most installations that is the user nobody)
If this is a nix host you can try using the /tmp directory for your uploads. Propably it wont have any problem.
Maybe you can try the php chmod command to make this a little more automated within your script, but propably your host wont allow this.
I can use the script if a new folder is created with 0777 but it's strange, Is this a common configuration of a webhost? don't have this with other hosts.
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 5799
46391 credits Members referred : 3
« Reply #5 on: Apr 08, 2006, 08:37:15 pm »
This is propably because the owner of the directory is not the same user with the Apache process or php runs under safe mode.