Folders created by PHP scripts are owned by 'apache' and not the server owner

When using a CMS (such as Wordpress) to upload images, the newly created folders and images are owned by user 'apache', rather than the virtual server owner, leading to permission problems.

"Server Templates > Default > Apache Website > Default PHP execution mode" is set to "FCGId (run as virtual server owner)".

"Virtual Server > Website Options > PHP script execution mode" is also set to "FCGId (run as virtual server owner)"

Any ideas?

Status: 
Active

Comments

It sounds like, for some reason, that it's still running as mod_php.

Can you create a script named test.php within your domain, and for it's contents, add this:

<? phpinfo(); ?>

Then, could you share with us the URL where we can see the output of that script? Thanks!

Well, that all looks normal -- it appears to be correctly running under FCGI/CGI.

Is this issue occurring for all domains? Or just this one?

Also, can you make a new PHP script named "file.php", and for it's contents, add the following:

<?php
shell_exec("touch foo.txt");
?>

Then, call that script from your browser. When you do that, it'll make a new empty file called "foo.txt". When you run "ls -l foo.txt", what is the output?