# It is possible to use environment variables in 'local.php'?

**URL:** <https://forum.mautic.org/t/it-is-possible-to-use-environment-variables-in-local-php/24360>\
**Category:** Mautic 3 - Install/Upgrade Support\
**Created:** [June 3, 2022, 9:11pm UTC](https://forum.mautic.org/t/it-is-possible-to-use-environment-variables-in-local-php/24360 "2022-06-03T21:11:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lopes80andre](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lopes80andre/32/637_2.png) [@lopes80andre](https://forum.mautic.org/u/lopes80andre)\
**Post date:** [June 3, 2022, 9:11pm UTC](https://forum.mautic.org/t/it-is-possible-to-use-environment-variables-in-local-php/24360/1 "2022-06-03T21:11:53Z")

</div>

Hi,

I’m moving Mautic from one server to another one. I want to automate the process using Ansible.

My question is about using environment variables in **local.php** , for example it is possible to do this?

Using **getenv()**:

```auto
<?php
$parameters = array(
	'db_driver' => 'pdo_mysql',
	'db_host' => 'localhost',
	'db_table_prefix' => null,
	'db_port' => getenv('DB_PORT'),
	'db_name' => getenv('DB_NAME'),
	'db_user' => getenv('DB_USER'),
	'db_password' => getenv('DB_PASSWORD'),
        ...

```

I ask this because I don’t know if Mautic rewrites this file.

I wait for reply.

Best Regards,
