Easy way to debug PHP script

If you can’t catch error in PHP script but something doesn’t work – add this to the beginning of your script:

ini_set('display_errors',1);
error_reporting(E_ALL);

this will allow you to see all errors.

Fix of error: “warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)”

Working with lot of servers, recently I logged into one of them and got an error while working with shell:

warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

It was very hard to work and see this error regularly so I found a fix.
Continue reading