# All files have root (instead of www-data) permission after running php upgrade\_v3.php. Is this OK?

**URL:** <https://forum.mautic.org/t/all-files-have-root-instead-of-www-data-permission-after-running-php-upgrade-v3-php-is-this-ok/20213>\
**Category:** Mautic 3 - Install/Upgrade Support\
**Tags:** community\
**Created:** [July 20, 2021, 9:15am UTC](https://forum.mautic.org/t/all-files-have-root-instead-of-www-data-permission-after-running-php-upgrade-v3-php-is-this-ok/20213 "2021-07-20T09:15:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hhjchen](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/hhjchen/32/2326_2.png) [@hhjchen](https://forum.mautic.org/u/hhjchen)\
**Post date:** [July 20, 2021, 9:15am UTC](https://forum.mautic.org/t/all-files-have-root-instead-of-www-data-permission-after-running-php-upgrade-v3-php-is-this-ok/20213/1 "2021-07-20T09:15:49Z")

</div>

**Your software** : Mautic 2.16.5 → Mautic 3.2.4 (Docker)  
_My PHP version is_ : 7.3  
_My MySQL/MariaDB version is_ (delete as applicable): MySQL5.7

**Updating/Installing Errors**  
_Upgrading/installing via_ (delete as applicable) : Command Line  
php upgrade\_v3.php

_These errors are showing in the installer_ :  
No errors. Upgrade script runs successfully but all files show root permission. I think that may be the cause of file write issues I encounter later after the upgade.

**Your problem**  
_My problem is_ :  
**All files show root permission instead of www-data. Is that expected?** I suspect it’s the reason why I still have issues when I finally upgrade to 3.3.3.

**What permission should the upgrade\_v3.php have and what user should I run it in?**

_Steps I have tried to fix the problem_ :  
I’ve ran it with:  
sudo php upgrade\_v3.php  
sudo -u www-data php upgrade\_v3.php  
sudo chown -u www-data:www-data upgrade\_v3.php and then running

**UPDATE/CLARIFICATION:** I still ran upgrade\_v3.php with root permission but applied the `sudo chown` **`-R`** `www-data:www-data *` to the Mautic directory afterwards before continuing with

```auto
sudo -u www-data php bin/console mautic:update:find
sudo -u www-data php bin/console mautic:update:apply

```

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [July 20, 2021, 11:47am UTC](https://forum.mautic.org/t/all-files-have-root-instead-of-www-data-permission-after-running-php-upgrade-v3-php-is-this-ok/20213/2 "2021-07-20T11:47:26Z")

</div>

have you tried chown -u www-data:www-data \* (on the whole Mautic directory)

---

<div class="post-metadata">

**Author:** ![hhjchen](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/hhjchen/32/2326_2.png) [@hhjchen](https://forum.mautic.org/u/hhjchen)\
**Post date:** [July 20, 2021, 2:07pm UTC](https://forum.mautic.org/t/all-files-have-root-instead-of-www-data-permission-after-running-php-upgrade-v3-php-is-this-ok/20213/3 "2021-07-20T14:07:59Z")

</div>

No, but I checked earlier, and the html directory in /var/www/html does have www-data permissions set. Should everything in the Mautic directory including sub-directories have www-data permissions set? If so, I guess I could try to force update the permissions and see if I still get the file write issues after the upgrade.

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [July 20, 2021, 2:29pm UTC](https://forum.mautic.org/t/all-files-have-root-instead-of-www-data-permission-after-running-php-upgrade-v3-php-is-this-ok/20213/4 "2021-07-20T14:29:54Z")

</div>

yes try put it on the entire mautic directory

---

<div class="post-metadata">

**Author:** ![hhjchen](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/hhjchen/32/2326_2.png) [@hhjchen](https://forum.mautic.org/u/hhjchen)\
**Post date:** [July 20, 2021, 3:21pm UTC](https://forum.mautic.org/t/all-files-have-root-instead-of-www-data-permission-after-running-php-upgrade-v3-php-is-this-ok/20213/5 "2021-07-20T15:21:38Z")

</div>

Yay, all right, that was it! Thanks!
