On my production server I have set the environment to ‘production’ in Codigniter’s index.php file:
define('ENVIRONMENT', 'production');
The case statement below this looks to be doing the right thing also (I haven’t changed it).
However PHP errors are still being displayed eg:
A Database Error Occurred
Error Number: 1054
Unknown column 'laassad' in 'field list'
SELECT laassad FROM contents LIMIT 1
Filename: /home/something/public_html/mysite/somemorestuff.php
Line Number: 11
This is obviously unattractive, and a security risk. Does anyone know what might be causing this behaviour and how I might fix it?
I am using ‘CI_VERSION’, ‘2.1.2’
Defining your environment as production only suppresses PHP errors – this is a DB error.
See this thread for answer: How to turn off mysql errors from being displayed to screen in CodeIgniter