A user seems to be usurping www-data....


I'm running Lucid Ubuntu with Apache2.

Mostly my site works well.

But: when PHP scripts execute mkdir() or moveuploadedfile commands, the newly created folders/files are owned by another unix user, not www-data. www-data owns the containing folder.

I did create this other user, but it shouldn't be owning these files.

When I log in with my public key, a different user – not the troublesome one -- is used.

The troublesome user also owns my PHP sessions when they get created, although nothing else.

When I delete the user (the bad one) I can't restart Apache -- I get "bad username." My PHP sessions also break.

So I add the user again and I'm back where I started.

Any ideas?

Thanks so much,


3 Replies

It sounds like PHP is running as the "troublesome" user. How are you running PHP (mod_php, cgi, fpm, etc.)?


Thanks for thinking about this. I had mpm directives that made apache run as the troublesome user. In /etc/apache2/sites-enabled/. Not sure how that happened, but it's fixed now.

Apologies, this seeems like a noob mistake. Thanks again for responding.


No problem. Glad to see you got it figured out.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct