Change default php values

Hi,

currently all user and web sites will only work well with php values greater than the default, I can change these via:

/etc/php/7.*/apache2/php.ini
/home/user/conf/web/domain.com/apache2.ssl.conf

The problem is that after each CP update or rebuild the settings in
/home/user/conf/web/domain.com/apache2.ssl.conf

change back to the default which are set in
/usr/local/hestia/data/templates/web/apache2/php-fpm/hosting.stpl

I can edit the above template, but as i understand it this is also over written on update/rebuild.

As i understand it i can copy the above template to a new template which will not be updated on update/rebuild, though if there are any changes to the default template on update i will need to transfer these to the copied template.

Is there a way to set default php values with the need to copy default to new template and not have edits over written on update/rebuild?

thanks

First of all, in every template you got this warning, I think that should be enough to show that you should not touch this files :slight_smile::

Changing the php values depends if you’re using fpm or not, since 1.1.0 hestia uses fpm per default. If you use fpm, you can adjust the default files in /etc/php/version/fpm/, also you can create own templates with a few easy steps: https://docs.hestiacp.com/admin_docs/server_management.html#how-do-web-templates-work

Hi, yes i am aware of the warning, but with no other way to set php values what am i to do?

the problem is that the settings in

/etc/php/version/fpm/ph.ini

after a domain rebuild are not being reflected in

/home/user/conf/web/domain.com/apache2.ssl.conf

After domain rebuild it always has

php_admin_value upload_max_filesize 10M
php_admin_value max_execution_time 20
php_admin_value post_max_size 8M
php_admin_value memory_limit 32M

For instance the memory limit should be 512M as it is set in the /etc/php/version/fpm/php.ini

grep -iRl “memory_limit = 512M” /etc/php/
/etc/php/7.3/cgi/php.ini
/etc/php/7.3/cgi/php.ini.vst.back
/etc/php/7.3/cli/php.ini
/etc/php/7.3/cli/php.ini.vst.back
/etc/php/7.3/apache2/php.ini
/etc/php/7.3/apache2/php.ini.vst.back
/etc/php/7.3/fpm/php.ini
/etc/php/7.3/fpm/php.ini.vst.back
/etc/php/7.4/cli/php.ini
/etc/php/7.4/cli/php.ini.vst.back
/etc/php/7.4/fpm/php.ini
/etc/php/7.4/fpm/php.ini.vst.back
/etc/php/5.6/cli/php.ini
/etc/php/5.6/cli/php.ini.vst.back
/etc/php/5.6/fpm/php.ini
/etc/php/5.6/fpm/php.ini.vst.back
/etc/php/7.0/cli/php.ini
/etc/php/7.0/cli/php.ini.vst.back
/etc/php/7.0/fpm/php.ini
/etc/php/7.0/fpm/php.ini.vst.back
/etc/php/7.1/cli/php.ini
/etc/php/7.1/cli/php.ini.vst.back
/etc/php/7.1/fpm/php.ini
/etc/php/7.1/fpm/php.ini.vst.back
/etc/php/7.2/cli/php.ini
/etc/php/7.2/cli/php.ini.vst.back
/etc/php/7.2/fpm/php.ini
/etc/php/7.2/fpm/php.ini.vst.back

whereas the setting of 32M keeps being set in users php.ini?

Question is where can it be found?

grep -iRl “memory_limit = 32M” /etc/php/

[email protected] ~

Forgive me if i am being a bit dim, but surely being able to easily able to set both default php values and and per user php values should be easy?

Did you try setting them in .htaccess or .user.ini in the website root directory? That way each site will retain the correct values.

I should not need to, if they are set in /etc/php/version/fpm/ph.ini then they should be reflected in
/home/user/conf/web/domain.com/apache2.ssl.conf !!

Changes made in php.ini will not update any preset values in Apache2.ssl.conf for that domain

Just remove those preset values from you template and it should work fine. Or use as explained .user.ini or .htaccess (Probally not work because default is fpm)