# Wrong group name for user after PHP file upload

**URL:** <https://forum.virtualmin.com/t/wrong-group-name-for-user-after-php-file-upload/124324>\
**Category:** Virtualmin\
**Created:** [January 6, 2024, 2:40am UTC](https://forum.virtualmin.com/t/wrong-group-name-for-user-after-php-file-upload/124324 "2024-01-06T02:40:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DonX](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/d/e95f7d/32.png) [@DonX](https://forum.virtualmin.com/u/DonX)\
**Post date:** [January 6, 2024, 2:40am UTC](https://forum.virtualmin.com/t/wrong-group-name-for-user-after-php-file-upload/124324/1 "2024-01-06T02:40:27Z")

</div>

| SYSTEM INFORMATION | |
| --- | --- |
| OS type and version | AlmaLinux 8.9 |
| Webmin version | 2.105 |
| Usermin version | 2.005 |
| Virtualmin version | 7.9.0 |
| Theme version | 21.09.5 |
| Package updates | All installed packages are up to date |

Hello everyone,

Whenever a file is uploaded to a specific user’s public\_html directory, the group name for that file is incorrect; it shows up as another username for the group.

So for example, instead of this:

`filename.jpg user: rightUser | group: rightUser`

I get this:

`filename.jpg user: rightUser | group: anotherUser`

To get an idea of what I’m experiencing, see the the following link, but I’m not sure if the solution posted there is the right one for me.

> <https://stackoverflow.com/questions/7694779/group-and-owner-permissions-are-wrong-when-php-uploads-files>

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [January 6, 2024, 4:20am UTC](https://forum.virtualmin.com/t/wrong-group-name-for-user-after-php-file-upload/124324/2 "2024-01-06T04:20:54Z")

</div>

If the group or user is the Apache user (which is what that link is showing with `www-data`), then it means you’ve installed `mod_php` and shouldn’t have.

---

<div class="post-metadata">

**Author:** ![DonX](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/d/e95f7d/32.png) [@DonX](https://forum.virtualmin.com/u/DonX)\
**Post date:** [January 6, 2024, 4:49am UTC](https://forum.virtualmin.com/t/wrong-group-name-for-user-after-php-file-upload/124324/3 "2024-01-06T04:49:25Z")

</div>

Hi Joe,

Thanks for writing.

The user/group is actually another virtual host site, not Apache in my case.

So its like this:

`filename.jpg user: site_1 | group: site_3`

Instead of being:

`filename.jpg user: site_1 | group: site_1`

---

<div class="post-metadata">

**Author:** ![DonX](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/d/e95f7d/32.png) [@DonX](https://forum.virtualmin.com/u/DonX)\
**Post date:** [January 6, 2024, 6:34am UTC](https://forum.virtualmin.com/t/wrong-group-name-for-user-after-php-file-upload/124324/4 "2024-01-06T06:34:28Z")

</div>

Update:

So after going into the PHP-FPM configuration file for the virtual host in question, ‘group’ and ‘listen.group’ was set to another virtual host.

It was like this:

```auto
user = site_1
group = site_3
listen.owner = site_1
listen.group = site_3

```

I edited the config file as follows:

```auto
user = site_1
group = site_1
listen.owner = site_1
listen.group = site_1

```

Then restarted PHP-FPM and attempted to upload a file, then went to check if the group name was correct for the uploaded file, and this time it was. I’m not sure why or how though the group names in the config file was altered/changed to another virtual host to begin with.

---

<div class="post-metadata">

**Author:** ![stefan1959](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/s/49beb7/32.png) [@stefan1959](https://forum.virtualmin.com/u/stefan1959)\
**Post date:** [January 6, 2024, 7:24am UTC](https://forum.virtualmin.com/t/wrong-group-name-for-user-after-php-file-upload/124324/5 "2024-01-06T07:24:46Z")

</div>

If you go to edit virtual server is the admin user and group correct?

---

<div class="post-metadata">

**Author:** ![DonX](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/d/e95f7d/32.png) [@DonX](https://forum.virtualmin.com/u/DonX)\
**Post date:** [January 6, 2024, 7:52pm UTC](https://forum.virtualmin.com/t/wrong-group-name-for-user-after-php-file-upload/124324/6 "2024-01-06T19:52:06Z")

</div>

Yes, they’re correct.

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [January 14, 2024, 7:52pm UTC](https://forum.virtualmin.com/t/wrong-group-name-for-user-after-php-file-upload/124324/7 "2024-01-14T19:52:48Z")

</div>

Closed on January 14, 2024, 7:52pm UTC

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.
