# Why does local.php get deleted every time I do a composer update?

**URL:** <https://forum.mautic.org/t/why-does-local-php-get-deleted-every-time-i-do-a-composer-update/25520>\
**Category:** General Discussion\
**Created:** [September 27, 2022, 2:00pm UTC](https://forum.mautic.org/t/why-does-local-php-get-deleted-every-time-i-do-a-composer-update/25520 "2022-09-27T14:00:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)\
**Post date:** [September 27, 2022, 2:00pm UTC](https://forum.mautic.org/t/why-does-local-php-get-deleted-every-time-i-do-a-composer-update/25520/1 "2022-09-27T14:00:49Z")

</div>

Is it normal for local.php to be deleted every time I do a composer update?

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [September 27, 2022, 2:02pm UTC](https://forum.mautic.org/t/why-does-local-php-get-deleted-every-time-i-do-a-composer-update/25520/2 "2022-09-27T14:02:29Z")

</div>

just do full backup before every update - you should do the backup anyway.

And to answer question directly… no, I think this is something that should be resolved I would open a ticket if it does not exist already.

---

<div class="post-metadata">

**Author:** ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)\
**Post date:** [September 27, 2022, 2:05pm UTC](https://forum.mautic.org/t/why-does-local-php-get-deleted-every-time-i-do-a-composer-update/25520/3 "2022-09-27T14:05:56Z")

</div>

I have open ticket like months ago lol but thanks anyway …

Curious … Do you do composer update or still using php zip? If composer update, does your local.php get deleted after each use?

I have backups between each update

 ![Screen Shot 2022-09-27 at 9.05.23 AM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/ad8346c5a65d1becfa778eddb34eac424b7f7a0d.jpeg)

---

<div class="post-metadata">

**Author:** ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)\
**Post date:** [September 27, 2022, 2:08pm UTC](https://forum.mautic.org/t/why-does-local-php-get-deleted-every-time-i-do-a-composer-update/25520/4 "2022-09-27T14:08:37Z")

</div>

The ticket … June 27th …

> <https://github.com/mautic/mautic/issues/11293>
>
> \### Mautic Version
> 
> 4.3.x series
> 
> \### PHP version
> 
> 7.4.+
> 
> \### What brows…ers are you seeing the problem on?
> 
> Not relevant
> 
> \### What happened?
> 
> Saw a tweet announcement about the minor update 4.4.0 release. Did a composer update and was greeted with a new mautic installation page. 
> 
> Noticed that local.php file was deleted during a composer update (did test composer update three times after restoring from backup and it still deleted the local.php file each time) 
> 
> Restoring local.php file from 4.3.1 to 4.4.0 fixes it. 
> 
> \### How can we reproduce this issue?
> 
> Step 1: composer update --no-interaction
> Step 2: go to your Mautic page - if shows as new installation then restore local.php from previous version and empty cache. 
> 
> \### Relevant log output
> 
> \_No response\_
> 
> \### Code of Conduct
> 
> \- \[X\] I confirm that I have read and agree to follow this project's Code of Conduct
> 
> \<bountysource-plugin\>
> 
> \---
> Want to back this issue? \*\*\[Post a bounty on it!\](https://app.bountysource.com/issues/109790894-composer-update-4-4-0-deletes-local-php-file?utm\_campaign=plugin&utm\_content=tracker%2F5355074&utm\_medium=issues&utm\_source=github)\*\* We accept bounties via \[Bountysource\](https://app.bountysource.com/?utm\_campaign=plugin&utm\_content=tracker%2F5355074&utm\_medium=issues&utm\_source=github).
> \</bountysource-plugin\>

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [September 27, 2022, 2:08pm UTC](https://forum.mautic.org/t/why-does-local-php-get-deleted-every-time-i-do-a-composer-update/25520/5 "2022-09-27T14:08:40Z")

</div>

Most of the time, I clone repo. and install the matic using bin/console so I do not use composer based installation all the time.

So I cannot really give you any more info on disapering local.php file.

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [September 27, 2022, 2:10pm UTC](https://forum.mautic.org/t/why-does-local-php-get-deleted-every-time-i-do-a-composer-update/25520/6 "2022-09-27T14:10:25Z")

</div>

Maybe core team will accept it, if you create a PR & tests for the issue 🙂

---

<div class="post-metadata">

**Author:** ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)\
**Post date:** [September 27, 2022, 2:12pm UTC](https://forum.mautic.org/t/why-does-local-php-get-deleted-every-time-i-do-a-composer-update/25520/7 "2022-09-27T14:12:08Z")

</div>

Don’t know how to do that so please do explain it to me how and I will go do it.

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [September 27, 2022, 2:16pm UTC](https://forum.mautic.org/t/why-does-local-php-get-deleted-every-time-i-do-a-composer-update/25520/8 "2022-09-27T14:16:41Z")

</div>

Short answer: It is ‘normal’ because we have our config in our /app folder which should not be the case, but that is how things were done when Mautic was created. We can’t change that until Mautic 5 as it will break backwards compatibility.

We are planning to properly decouple things like configuration, user-uploaded resources etc from the core, so that anything you change or tweak is not impacted by composer updates. So yes, for now, please back up before updating!
