2

I use SuexecUserGroup for VirtualHost

Script

<?php
echo '<pre>';
var_dump(exec('whoami'));
echo "Current Script Owner: ".get_current_user()."\n";

return 'www-data' in first string and right user 'correct_user' in second string

Created files has user name - www-data

How to create files with user 'correct_user' owner?

Alexander
  • 21
  • 1
  • 1
    possible duplicate of [PHP: get\_current\_user() vs. exec('whoami')](http://stackoverflow.com/questions/28548743/php-get-current-user-vs-execwhoami) – kittykittybangbang Jun 07 '15 at 04:35
  • Maybe you can use [chown](http://php.net/manual/en/function.chown.php) to change the file's owner after its creation. If that's not an option, maybe to change the user that executes the script (in httpd.conf) is...? – einjohn Jan 15 '16 at 16:14

0 Answers0