# Custom PHP variables in php8.3-fpm

**URL:** <https://forum.hestiacp.com/t/custom-php-variables-in-php8-3-fpm/22447>\
**Category:** General Questions\
**Created:** [November 10, 2026, 9:20am UTC](https://forum.hestiacp.com/t/custom-php-variables-in-php8-3-fpm/22447 "2026-11-10T09:20:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![CryWolf](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/c/e495f1/32.png) [@CryWolf](https://forum.hestiacp.com/u/CryWolf)\
**Post date:** [November 10, 2026, 9:20am UTC](https://forum.hestiacp.com/t/custom-php-variables-in-php8-3-fpm/22447/1 "2026-11-10T09:20:27Z")

</div>

Hi there , is there a way to add custom variables tot php-fpm such as

env[BOT\_PROTECTION] = on  
env[TURNSTILE\_SITE\_KEY] = PUBKEY  
env[TURNSTILE\_SECRET\_KEY] = SECRETKEY  
env[ALLOWED\_HOSTS] = [domainname.com](http://domainname.com)  
env[BOT\_TTL] = 1800

because ading them to /etc/php/8.3/fpm/pool.d/ [domainname.com](http://domainname.com) they dissapear after rebuilding domain , im sorry if was already posted but i searched using google and found no info on this matter

Thanks

---

<div class="post-metadata">

**Author:** ![stepan39](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@stepan39](https://forum.hestiacp.com/u/stepan39)\
**Post date:** [November 10, 2026, 9:53am UTC](https://forum.hestiacp.com/t/custom-php-variables-in-php8-3-fpm/22447/2 "2026-11-10T09:53:49Z")

</div>

> [@CryWolf](#):
>
> rebuilding domai

Create a template at the path:  
`/usr/local/hestia/data/templates/web/php-fpm/custom-PHP-8_3.tpl`  
_(Note: the “custom” part can be any name you want, but “PHP-8\_3.tpl” is important)_

Copy the contents from:  
`/usr/local/hestia/data/templates/web/php-fpm/PHP-8_3.tpl`  
into it.

Make the necessary additions:

text

```auto
env[BOT_PROTECTION] = on
env[TURNSTILE_SITE_KEY] = PUBKEY
env[TURNSTILE_SECRET_KEY] = SECRETKEY
env[ALLOWED_HOSTS] = domainname.com
env[BOT_TTL] = 1800

```

Rebuild the domain, then check its functionality and the configuration changes.

Below is an example of my config:  
`/usr/local/hestia/data/templates/web/php-fpm/custom-Joomla-PHP-8_4.tpl`

; origin-src: deb/php-fpm/multiphp.tpl  
;#=========================================================================#  
;# Custom Joomla PHP-FPM Template #  
;# Based on Default Web Domain Template #  
;# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #  
;# [Web Templates and FastCGI/Proxy Cache | Hestia Control Panel](https://hestiacp.com/docs/server-administration/web-templates.html) #  
;#=========================================================================#

[%domain%]  
listen = /run/php/php%backend\_version%-fpm-%domain%.sock  
listen.owner = %user%  
listen.group = www-data  
listen.mode = 0660  
listen.backlog = 1024

user = %user%  
group = %user%

pm = dynamic  
pm.max\_children = 8  
pm.start\_servers = 4  
pm.min\_spare\_servers = 3  
pm.max\_spare\_servers = 7  
pm.max\_requests = 3000  
pm.status\_path = /status

request\_terminate\_timeout = 180s  
request\_slowlog\_timeout = 10s  
slowlog = /var/log/php-fpm/$pool-slow.log  
catch\_workers\_output = yes

php\_admin\_value[upload\_tmp\_dir] = /home/%user%/tmp  
php\_admin\_value[session.save\_path] = /home/%user%/tmp  
php\_admin\_value[open\_basedir] = /home/%user%/.composer:/home/%user%/web/%domain%/public\_html:/home/%user%/web/%domain%/private:/home/%user%/web/%domain%/public\_shtml:/home/%user%/tmp:/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt  
php\_admin\_value[sendmail\_path] = /usr/sbin/sendmail -t -i -f admin@%domain%

env[PATH] = /usr/local/bin:/usr/bin:/bin  
env[TMP] = /home/%user%/tmp  
env[TMPDIR] = /home/%user%/tmp  
env[TEMP] = /home/%user%/tmp

---

<div class="post-metadata">

**Author:** ![CryWolf](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/c/e495f1/32.png) [@CryWolf](https://forum.hestiacp.com/u/CryWolf)\
**Post date:** [November 10, 2026, 10:27am UTC](https://forum.hestiacp.com/t/custom-php-variables-in-php8-3-fpm/22447/3 "2026-11-10T10:27:51Z")

</div>

Hy there thanks for answering i did custom-PHP-8\_3.tpl added contents from PHP-8\_3.tpl and my extra contents and v-rebuild-web-domain hestiacp\_user [domainname.com](http://domainname.com) still doesnt work after removing contents from /etc/php/8.3/fpm/pool.d/ [domainname.com](http://domainname.com) ☹

---

<div class="post-metadata">

**Author:** ![stepan39](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@stepan39](https://forum.hestiacp.com/u/stepan39)\
**Post date:** [November 10, 2026, 10:38am UTC](https://forum.hestiacp.com/t/custom-php-variables-in-php8-3-fpm/22447/4 "2026-11-10T10:38:58Z")

</div>

Did you select the custom template in the domain settings? You shouldn’t touch `/etc/php/8.3/fpm/pool.d/domainname.com` — all the data there is generated automatically from the template after the rebuild.

---

<div class="post-metadata">

**Author:** ![CryWolf](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/c/e495f1/32.png) [@CryWolf](https://forum.hestiacp.com/u/CryWolf)\
**Post date:** [November 10, 2026, 10:41am UTC](https://forum.hestiacp.com/t/custom-php-variables-in-php8-3-fpm/22447/5 "2026-11-10T10:41:41Z")

</div>

Yes i did select it now the custom-PHP-8\_3.tpl

but

[Tue Nov 10 10:38:29.245300 2026] [proxy\_fcgi:error] [pid 178345:tid 178359] [client 79.115.20.40:0] AH01079: failed to make connection to backend: localhost  
[Tue Nov 10 10:38:30.533042 2026] [proxy:error] [pid 178345:tid 178362] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.3-fpm-dark-arena.com.sock\r (localhost:8000) failed  
[Tue Nov 10 10:38:30.533075 2026] [proxy\_fcgi:error] [pid 178345:tid 178362] [client 79.115.20.40:0] AH01079: failed to make connection to backend: localhost  
[Tue Nov 10 10:38:31.029612 2026] [proxy:error] [pid 178344:tid 178347] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.3-fpm-dark-arena.com.sock\r (localhost:8000) failed  
[Tue Nov 10 10:38:31.029671 2026] [proxy\_fcgi:error] [pid 178344:tid 178347] [client 79.115.20.40:0] AH01079: failed to make connection to backend: localhost  
[Tue Nov 10 10:38:31.538674 2026] [proxy:error] [pid 178345:tid 178366] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.3-fpm-dark-arena.com.sock\r (localhost:8000) failed  
[Tue Nov 10 10:38:31.538702 2026] [proxy\_fcgi:error] [pid 178345:tid 178366] [client 79.115.20.40:0] AH01079: failed to make connection to backend: localhost  
[Tue Nov 10 10:38:36.550150 2026] [proxy:error] [pid 178345:tid 178371] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.3-fpm-dark-arena.com.sock\r (localhost:8000) failed  
[Tue Nov 10 10:38:36.550187 2026] [proxy\_fcgi:error] [pid 178345:tid 178371] [client 79.115.20.40:0] AH01079: failed to make connection to backend: localhost

---

<div class="post-metadata">

**Author:** ![stepan39](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@stepan39](https://forum.hestiacp.com/u/stepan39)\
**Post date:** [November 10, 2026, 10:43am UTC](https://forum.hestiacp.com/t/custom-php-variables-in-php8-3-fpm/22447/6 "2026-11-10T10:43:31Z")

</div>

**What is the exact name of the template you created?**

---

<div class="post-metadata">

**Author:** ![CryWolf](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/c/e495f1/32.png) [@CryWolf](https://forum.hestiacp.com/u/CryWolf)\
**Post date:** [November 10, 2026, 10:44am UTC](https://forum.hestiacp.com/t/custom-php-variables-in-php8-3-fpm/22447/7 "2026-11-10T10:44:43Z")

</div>

> [@CryWolf](#):
>
> custom-PHP-8\_3.tpl

custom-PHP-8\_3.tpl

yes and selected it attempting to connect to php8.3-fpm-dark-arena.com.sock errror but file is there

HestiaCP as a verry good web hosting should at least have the option to disable auto rebuild it’s not fair for most of custom owners to force in such things , everyone who disables it should already know what they are doing ☹

---

<div class="post-metadata">

**Author:** ![stepan39](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@stepan39](https://forum.hestiacp.com/u/stepan39)\
**Post date:** [November 10, 2026, 10:48am UTC](https://forum.hestiacp.com/t/custom-php-variables-in-php8-3-fpm/22447/8 "2026-11-10T10:48:23Z")

</div>

> [@stepan39](#):
>
> /usr/local/hestia/data/templates/web/php-fpm/PHP-8\_3.tpl

1. Replace the entire contents of the custom template with the contents from the original file:  
`/usr/local/hestia/data/templates/web/php-fpm/PHP-8_3.tpl`

2. Rebuild the domain.

3. Check it.

Everything should work!  
Going forward, make changes one by one to see what is causing the error.

---

<div class="post-metadata">

**Author:** ![CryWolf](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/c/e495f1/32.png) [@CryWolf](https://forum.hestiacp.com/u/CryWolf)\
**Post date:** [November 10, 2026, 10:54am UTC](https://forum.hestiacp.com/t/custom-php-variables-in-php8-3-fpm/22447/9 "2026-11-10T10:54:30Z")

</div>

Solved thanks !

Using default editor to create file custom-PHP-8\_3.tpl trows that error but after using “/usr/local/hestia/data/templates/web/php-fpm# cp PHP-8\_3.tpl custom-PHP-8\_3.tpl” worked !

Thanks
