Understanding the .user.ini file
Hi, so i am just now learning about the .user.ini files created in cpanel. Yeah im late to the game lol hee hee
I was wondering why my local php.ini file that i was accustomed to creating in a new domain was not working and then i discovered the .user.ini file
So if i understand this correctly?
1. creating local (domain) php.ini files is no longer the procedure, we now crerate a .user.ini file for any php settings we only want to effect the local domain. (assuming that directive is enabled in whm server config) (example allow_url_fopen)
2. Any directives we want to set globally by php version, we can do so via WHM Multiphp INI feature.
3. php.ini file is now used in the main server level config files as a global server wide directive (via #2 above)
I know its not that simple, but basically in simple terms do i have that correct?
Second question: Are all of these available (can be set) php 8.2 and php 8.3 for using the .user.ini file
;better security
expose_php = Off
;other stuff
display_errors = Off
max_execution_time = 180
max_input_time = 60
memory_limit = 1024M
post_max_size = 70M
upload_max_filesize = 70M
log_errors = On
max_input_vars = 1000
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php83"
allow_url_fopen = Off
allow_url_include = Off
zlib.output_compression = Off
error_log = '/home/username/example.com/error_log'
date.timezone = "America/Chicago"
;can we also set the ioncube loader location here
Update:
I did notice that expose_php, allow_url_open, and allow_url_include were all removed from the .user.ini file when i saved the multiINI data using the cpanel UI feature.
So how do we set those locally?
Also i did notice that it also recreated a php.ini file with some basic settings in it.
So now we have to monitor both files?
What goes in what, what takes precedence?
Thanks... :)
-
Hi,
1. creating local (domain) php.ini files is no longer the procedure, we now crerate a .user.ini file for any php settings we only want to effect the local domain. (assuming that directive is enabled in whm server config) (example allow_url_fopen
PHP settings are managed by directives in the php.ini, .user.ini and .htaccess files. Depending on the PHP handler in-use, one of these files might be used but not another one. It is generally recommended to use the MultiPHP INI Editor in cPanel to apply PHP configuration changes as that will ensure the changes are applied to the correct files.
Second question: Are all of these available (can be set) php 8.2 and php 8.3 for using the .user.ini file
Many of those directives can be configured with a .user.ini, but some of them can only be changed on the server level within the WHM MultiPHP Manager. For reference, the PHP directives that have the INI_SYSTEM value can only be changed in the WHM MultiPHP Manager and would have no effect if you tried to update the values in the .user.ini or the cPanel MultiPHP Manager:
https://www.php.net/manual/en/ini.list.php
1 -
Thanks William, appreciate the reply and the link, great link. I did not realize there were so many directives. Have a great weekend :)
0
Please sign in to leave a comment.
Comments
2 comments