Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
04-04-2011, 06:25 PM #1
- Join Date
- Jan 2005
- Mauchline, Scotland
- Thanked 1 Time in 1 Post
php apache file ownership and creation problem
I am trying to do a really basic rename of a file to another name in my code. However there seems to be some ownership/permissions problem that is stopping this working correctly.
This is my (simplified) code:
ini_set ("display_errors", "1");
$St_Num = '7940';
$Co_Code = 'RDCO2';
-rw-r--r-- 1 apache dev 4065 Oct 22 17:57 7940-RDCO2-3.jpg -rw-r--r-- 1 apache dev 4276 Oct 28 09:39 7940-RDCO2-2.jpg -rw-r--r-- 1 apache dev 4336 Oct 28 09:39 7940-RDCO2-1.jpg
I'm stumped with this one now - any help is appreciated.
04-05-2011, 03:21 AM #2
- Join Date
- Apr 2011
- Thanked 3 Times in 3 Posts
Who was the original owner of the file(s) in question? I'm thinking that file permissions are probably for all users to have read access only and only the file owner (apache) to have write access. You will have to change the file permissions to allow all users to write the file, from the console it would be something like chmod a+w ./<filename> .
However that would be a bad idea since that would make it so that anyone to write to the file not just your intended user. Why do the files need to be owned by the apache user?