PHP INI

SettingCurrentRecomendedDescription
allow_url_fopen10Remote files should not be accessable using fopen.
allow_url_include00You should not be able to include remote scripts using include.
always_populate_raw_post_data00This does not need to be used. The preferred method for accessing the raw POST data is php://input.
display_errors00Error messages should be suppressed
display_startup_errors00Startup errors should be suppressed.
enable_dl00Disable loading of dynamic extensions.
error_log/custom/locationShould be set to the location of the php error log.
file_uploads10This may be impractical but if not needed file uploading should be disabled.
log_errors11All errors generated by PHP should be logged to a file.
log_errors_max_len1024> 2048At least 2048 characters of the error message should be stored in the error log.
max_execution_time30< 20Execution time should be limited to 20 seconds or less.
max_file_uploads20< 10The maximum mumber of files that can be uploaded in 1 go.
max_input_nesting_level64< 32Maximum level of nesting of objects 32 is sufficent.
memory_limit134217728< 16777216The maximum memory limit for each script should be 16M or less.
open_basedir/the/webrootLimit the files that can be opened by PHP to the webroot.
post_max_size8388608< 4194304The maximum post size should as small as reasonably possible to mitigate the risk of DOS attacks.
session.cookie_httponly01Cookies must be httponly by default
session.entropy_file/dev/randomProvides a random seed for generating the session.
session.entropy_length0> 32The number of bytes to read for gathering entropy for session generation.
session.hash_bits_per_character0> 5The number of bits encoded per character of the session key.
session.hash_function01MD5 should be replaced with SHA-160 as it is a more complex and secure hashing algorithm.
session.namePHPSESSIDCustom StringThe name given to the PHP Session. It is recomended this be changed from the default.
session.save_path/var/opt/rh/rh-php73/lib/php/session/custom/locationThe save path for the session should be changed from the default /tmp.
session.use_only_cookies11Session variables should only be passed in cookies.
session.use_trans_sid00Sessions should not be allowed in GET paramaters.
upload_max_filesize2097152< 8388608The maximum upload file size should be less than or equal to the maximum post size.
upload_tmp_dir/custom/locationChange the location of where files are initally uploaded to

PHP Disabled Functions

SettingCurrentRecomendedDescription
diskfreespaceenableddisabled
dlenableddisabled
escapeshellargenableddisabled
escapeshellcmdenableddisabled
execenableddisabled
fpaththruenableddisabled
fsocket_openenableddisabled
getmypidenableddisabled
getmyuidenableddisabled
highlight_fileenableddisabled
ignore_user_abortenableddisabled
ini_alterenableddisabled
leakenableddisabled
limitenableddisabled
linkenableddisabled
listenenableddisabled
packenableddisabled
parse_ini_fileenableddisabled
passthruenableddisabled
php_unameenableddisabled
phpinfoenableddisabled
popenenableddisabled
posixenableddisabled
posix_ctermidenableddisabled
posix_getcwdenableddisabled
posix_getegidenableddisabled
posix_geteuidenableddisabled
posix_getgidenableddisabled
posix_getgrgidenableddisabled
posix_getgrnamenableddisabled
posix_getgroupsenableddisabled
posix_getloginenableddisabled
posix_getpgidenableddisabled
posix_getpgrpenableddisabled
posix_getpidenableddisabled
posix_getpwnamenableddisabled
posix_getpwuidenableddisabled
posix_getrlimitenableddisabled
posix_getsidenableddisabled
posix_getuidenableddisabled
posix_isattyenableddisabled
posix_killenableddisabled
posix_mkfifoenableddisabled
posix_setegidenableddisabled
posix_seteuidenableddisabled
posix_setgidenableddisabled
posix_setpgidenableddisabled
posix_setsidenableddisabled
posix_setuidenableddisabled
posix_timesenableddisabled
posix_ttynameenableddisabled
posix_unameenableddisabled
proc_closeenableddisabled
proc_get_statusenableddisabled
proc_niceenableddisabled
proc_openenableddisabled
proc_terminateenableddisabled
set_time_limitenableddisabled
shell_execenableddisabled
show_sourceenableddisabled
systemenableddisabled
tmpfileenableddisabled
virtualenableddisabled

PHP CONST

SettingCurrentRecomendedDescription
LIBXML_NOENT20External entities should be disabled for XML parsing
LIBXML_NONET20480Network access for XML parsers should be disabled.