If you don't run PHP in safe mode, you can execute shell commands.
With
Code:
<?php
$output = shell_exec("chown webx_user.webx filename");
echo $output;
?>
you can for example make filename owned by webx_user in the group webx.
Why do you want to do this though? Shouldn't the file be accessible by everyone after uploading? You wont be able to access the file with the user permissions of webx_user via PHP this way though. You should make sure the permissions are set to "chmod 666 filename" if it should be read/write accessible by everybody.
Btw, I even use PHP for shell scripting this way, because I know it better than Bash.
With a
Code:
#!/usr/bin/php
<?php
// code
?>
and a
Code:
chmod +x scriptname
you can just execute the script like any other shell script, if you have php installed. (Just a side remark)
__________________
Always mention at least your distribution/version! You can add it in your signature if you don't want to always type it. ;-)
Distributions:
Ubuntu 5.10 with custom kernel (2.6.16-suspend2),
Debian Sarge 3.1 and Etch
Please submit your ISP or Webhost to (free)
http://www.ihostnz.com
Recent comments
20 hours 17 min ago
1 day 1 hour ago
1 day 5 hours ago
1 day 7 hours ago
1 day 21 hours ago
1 day 21 hours ago
2 days 2 hours ago
2 days 9 hours ago
2 days 10 hours ago
2 days 11 hours ago