Ravindra BagaleCourses & study guides मराठी Track your progress

Ravi Sir's Cyber Security Cards › Revision Cards

Secure PHP Settings

Secure PHP Settings php.ini is PHP’s settings file. A few settings make a big safety difference. display_errors = Off : errors are not shown to visitors. expose_php = Off : hides the PHP version. log_errors = On : errors go to the log. One SQL error on screen can show table names and the query. That

Secure PHP Settings php.ini is PHP’s settings file. A few settings make a big safety difference. display_errors = Off : errors are not shown to visitors. expose_php = Off : hides the PHP version. log_errors = On : errors go to the log. One SQL error on screen can show table names and the query. That
Secure PHP Settings · Download PNG
Read card text

What this card says

What it is

php.ini is PHP’s settings file. A few settings make a big safety difference.

Key settings

display_errors = Off: errors are not shown to visitors.

expose_php = Off: hides the PHP version.

log_errors = On: errors go to the log.

Why it matters for security

One SQL error on screen can show table names and the query. That makes SQL injection much easier.

Real servers log errors. They never show them.

SettingSecure valueWhy
expose_phpOffHides the X-Powered-By: PHP/8.x header
display_errorsOffErrors with paths and SQL must not reach visitors
log_errorsOnErrors go to the log instead
allow_url_includeOffBlocks remote file inclusion
upload_max_filesize / post_max_sizeAs small as the app needsLimits abuse of uploads

Learn more in the lesson: 9.8 Secure PHP Settings

See all Ravi Sir's Cyber Security Cards