Problem when uploading files with Apache



Messages: 69


I use apache13 with FreeBSD 6.3.
I have some websites, in :

I use PHP 5 (compiled in apache module).

The rights are:

ls -ls /var/www/sites/site1: www:site1

All files are owned by www user. All files are grouped in site group.

If, in my php page, I create a folder, it have www:site1 in rights. Ok, it's good. However, if I create a file, it have www:wheel in rights.

What's the problem?

Apache runs in www:www. I does not have folder grouped in wheel group.

Why Apache set 'wheel' as group when I upload a file?

Do you have advices, solutions... ?



Well-Known Member

Reaction score: 81
Messages: 379

Default upload_tmp_dir is /tmp. This is owned by group wheel.

Php then moves the file to final destination, retaining ownership and permissions.

Set upload_tmp_dir in php.ini to a different directory, with group www and your problem will go away.